[text] rr

Viewer

  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int number = 0;
  6.  
  7.     cout << "Через цикл while:" << endl;
  8.     while (number <= 100) {
  9.         cout << number << endl;
  10.         number += 2;
  11.     }
  12.  
  13.     cout << "Через цикл for:" << endl;
  14.     for (int i = 0; i <= 100; i += 2) {
  15.         cout << i << endl;
  16.     }
  17.  
  18.     return 0;
  19. }
  20.  

Editor

You can edit this paste and save as new: