Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int A, B;
- cin >> A;
- cin >> B;
- int parni_broevi = 0, zbir = 0;
- int i = A;
- while(i <= B) {
- if(i % 2 == 0) {
- zbir += i;
- parni_broevi++;
- }
- i++;
- }
- cout << "Broj na parni broevi: " << parni_broevi << endl;
- cout << "Zbir " << zbir << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement