Advertisement
josiftepe

Untitled

Jan 28th, 2021
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void print(int n) {
  4.     if(n % 2 == 1) {
  5.         cout << "Neparen e brojot" << endl;
  6.         return; // ako e neparen brojot, zavrsi ja funkcijata i ne gledaj nisto posle ova
  7.     }
  8.     for(int i = 1; i <= n; i++) {
  9.         cout << i << endl;
  10.     }
  11. }
  12. int main (){
  13.     print(9);
  14.   return 0;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement