Create an Algorithm, Flowchart and C++ program based on the requirements below:
Problem:
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!
#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;
}
Comments
Leave a comment