Answer to Question #265331 in C++ for maks

Question #265331

Create an Algorithm, Flowchart and C++ program based on the requirements below:

Problem:

  1. Ask the user to enter a number, the program will determine whether the number is odd or even.

Output: 2 Sample Scenario

Even or Odd

Enter a number: 50

The number 50 is Even!

-------------------------------------

Even or Odd

Enter a number: 71

The number 71 is Odd!


1
Expert's answer
2021-11-13T01:18:13-0500


#include <iostream>


using namespace std;


int main()
{
    cout<<"\nEven or Odd";
    int n;
    cout<<"\nEnter a number: ";
    cin>>n;
    
    if(n%2==0)
        cout<<"\nThe number "<<n<<" is Even!";
    else
        cout<<"\nThe number "<<n<<" is Odd!";


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS