josiftepe

Untitled

Jan 27th, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.    
  6.     int pocetok = 1;
  7.     int kraj = 50;
  8.     while (pocetok <= kraj) {
  9.         cout << pocetok << endl;
  10.         pocetok += 1;
  11.     }
  12.    
  13.     // pocetok = 1
  14.     // kraj = 100
  15.     // if(1 <= 100) - true
  16.     // 1
  17.     // pocetok = 2
  18.     // if(2 <= 100) - true
  19.     // 2
  20.     // pocetok += 1 = 3
  21.     // .
  22.     // .
  23.     // .
  24.     // pocetok = 100
  25.     // if(100 <= 100) - true;
  26.     // 100
  27.     // pocetok = 100 + 1 = 101
  28.     // if(101 <= 100) - false
  29.     // ke zavrsi ciklusot posle ova
  30.    
  31.     return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment