2 solutions

  • 0
    @ 2024-12-1 14:58:51

    #include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; for(int i=1;i<=n;i++) { if(i%2==0) { cout<<i<<" "; } } return 0; }

    • -1
      @ 2024-11-23 14:57:55
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a;
          cin>>a;
          for(int i=2;i<=a;i+=2)
          {
              cout<<i<<" ";
          }
          return 0;
      }
      
      
      • 1

      Information

      ID
      26
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      (None)
      # Submissions
      133
      Accepted
      62
      Uploaded By