Advertisement
Spocoman

03. Numbers 1...N with Step 3

Sep 6th, 2023
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int number;
  7.     cin >> number;
  8.  
  9.     for (int i = 1; i <= number; i += 3) {
  10.         cout << i << endl;
  11.     }
  12.  
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement