fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7.  
  8. int i = 2;
  9. while (i <= n) {
  10. cout << i << endl;
  11. i += 2;
  12. }
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5280KB
stdin
10
stdout
2
4
6
8
10