neogz

parni i neparni u intervalu

Nov 19th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.  
  5.     int broj = 15, parni = 0, neparni = 0;
  6.     while (broj<100)
  7.     {
  8.         if (broj % 2 == 0)parni++;
  9.         else neparni++;
  10.         broj++;
  11.     }
  12.     cout << "parni brojevi: " << parni << endl;
  13.     cout << "neparni brojevi: " << neparni << endl;
  14.  
  15.     system("pause > nul");
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment