fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4. using namespace std;
  5. int main()
  6. {
  7. int x;
  8. cin>>x;
  9. for (int i=1;i<=x;i++){
  10. if(i%2==0)
  11. cout<<i<<endl;
  12.  
  13.  
  14. }
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21. }
Success #stdin #stdout 0s 5268KB
stdin
10
stdout
2
4
6
8
10