josiftepe

Untitled

Oct 18th, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     // korisnikot vnesuva broj N, i treba da gi ispecatime site broevi od 1 do N
  8.     int N;
  9.     cin >> N;
  10.    
  11.     // for(start; end or condition; increment) {
  12.     // do something
  13.     //}
  14.     // start has to be a variable
  15.     // end has to be a condition
  16.     // condition : variable1 operator varialbe2
  17.     // increment: add x amount to start till reached end
  18.     for(int i = 1; i <= N; i += 1) {
  19.         cout << i << " ";
  20.     }
  21.    
  22.  
  23.  
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment