Advertisement
Josif_tepe

Untitled

May 20th, 2024
582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int i;
  7.     int parni = 0;
  8.     int neparni = 0;
  9.     for(i = 10; i <= 100; i += 1)
  10.     {
  11.         if(i % 2 == 0)
  12.         {
  13.             parni += i;
  14.         }
  15.         else
  16.         {
  17.             neparni += i;
  18.         }
  19.  
  20.     }
  21.     cout << parni << endl;
  22.     cout << neparni << endl;
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement