Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C++ even numbers query

C++ even numbers query

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasetutorial
9 Posts 5 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_15550513
    wrote on last edited by
    #1

    Write a C++ program that reads a positive integer n, and prints the first n even numbers. For example, one execution would look like this: Please enter a positive integer: 3 2 4 6 File Name evennumbers.cpp Score There are three tests each worth 2 points 1.#include 2.using namespace std; 3. 4.int main() 5. { 6. int n; 7. cout<<"Please enter a positive integer:"; 8. cin>>n; 9. 10. cout<<"These are all even numbers in between 1 to "<

    V D 2 Replies Last reply
    0
    • M Member_15550513

      Write a C++ program that reads a positive integer n, and prints the first n even numbers. For example, one execution would look like this: Please enter a positive integer: 3 2 4 6 File Name evennumbers.cpp Score There are three tests each worth 2 points 1.#include 2.using namespace std; 3. 4.int main() 5. { 6. int n; 7. cout<<"Please enter a positive integer:"; 8. cin>>n; 9. 10. cout<<"These are all even numbers in between 1 to "<

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      Well, looks like good and not complicated exercise. Did you solve it?

      M 2 Replies Last reply
      0
      • V Victor Nijegorodov

        Well, looks like good and not complicated exercise. Did you solve it?

        M Offline
        M Offline
        Member_15550513
        wrote on last edited by
        #3

        Hi it's okay when I run it,but the Autograrder says FAILED.What could be the problem? Should I submit the executable file only.If I rename the executable file as .cpp the Autograder results to errors of 2 .cpp files.What should I do please?

        V 1 Reply Last reply
        0
        • M Member_15550513

          Hi it's okay when I run it,but the Autograrder says FAILED.What could be the problem? Should I submit the executable file only.If I rename the executable file as .cpp the Autograder results to errors of 2 .cpp files.What should I do please?

          V Offline
          V Offline
          Victor Nijegorodov
          wrote on last edited by
          #4

          Sorry, I could not understand what you mean... :sigh: The code you've posted is not complete, it doesn't compile and it does nothing. :thumbsdown:

          1 Reply Last reply
          0
          • M Member_15550513

            Write a C++ program that reads a positive integer n, and prints the first n even numbers. For example, one execution would look like this: Please enter a positive integer: 3 2 4 6 File Name evennumbers.cpp Score There are three tests each worth 2 points 1.#include 2.using namespace std; 3. 4.int main() 5. { 6. int n; 7. cout<<"Please enter a positive integer:"; 8. cin>>n; 9. 10. cout<<"These are all even numbers in between 1 to "<

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            So what's the problem, exactly?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

            Richard Andrew x64R 1 Reply Last reply
            0
            • V Victor Nijegorodov

              Well, looks like good and not complicated exercise. Did you solve it?

              M Offline
              M Offline
              Member_15550513
              wrote on last edited by
              #6

              Hi it's okay when I run it,but the Autograrder says FAILED.What could be the problem? Should I submit the executable file only.If I rename the executable file as .cpp the Autograder results to errors of 2 .cpp files.What should I do please?

              V L 2 Replies Last reply
              0
              • M Member_15550513

                Hi it's okay when I run it,but the Autograrder says FAILED.What could be the problem? Should I submit the executable file only.If I rename the executable file as .cpp the Autograder results to errors of 2 .cpp files.What should I do please?

                V Offline
                V Offline
                Victor Nijegorodov
                wrote on last edited by
                #7

                Please, stop reposting the same! :mad: I've already read it (your post from 1-Mar-22 9:33) And answered!

                1 Reply Last reply
                0
                • M Member_15550513

                  Hi it's okay when I run it,but the Autograrder says FAILED.What could be the problem? Should I submit the executable file only.If I rename the executable file as .cpp the Autograder results to errors of 2 .cpp files.What should I do please?

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  How do you expect anyone here to answer? We have no idea what the Autograrder is, or what criteria it uses to judge your code. And unless you show the complete code we cannot suggest any changes.

                  1 Reply Last reply
                  0
                  • D David Crow

                    So what's the problem, exactly?

                    "One man's wage rise is another man's price increase." - Harold Wilson

                    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                    "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                    Richard Andrew x64R Offline
                    Richard Andrew x64R Offline
                    Richard Andrew x64
                    wrote on last edited by
                    #9

                    Is there any doubt? He wants someone to do his work. :laugh:

                    The difficult we do right away... ...the impossible takes slightly longer.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups