fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a, i = 0;
  8. cin >> a;
  9. while(i <= a)
  10. {
  11. i = i+2;
  12. cout << i << ' ';
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5320KB
stdin
2
stdout
2 4