Write a C++ Program to Find whether given Number is Odd or Even.
Answer Posted / hr
Solution:
/* C++ Program to Find whether given Number is Odd or Even */
#include<iostream>
using namespace std;
int main()
{
int a;
cout<<"Enter any positive number :: ";
cin>>a;
if(a%2==0)
{
cout<<"
The Entered Number [ "<<a<<" ] is EVEN Number.
";
}
else
{
cout<<"
The Entered Number [ "<<a<<" ] is ODD Number.
";
}
return 0;
}
Output:
/* C++ Program to Find whether given Number is Odd or Even */
Enter any positive number :: 1327
The Entered Number [ 1327 ] is ODD Number.
Process returned 0
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what kind of projects are suitable for c and c++
Can you pass an array to a function in c++?
What is encapsulation in C++? Give an example.
State the difference between delete and delete[].
What are the advantages of using friend classes?
Is map thread safe c++?
Evaulate: 22%5 a) 2 b) 4 c) 0
Is linux written in c or c++?
What are constructors in oop?
Explain the difference between realloc() and free() in c++?
Can I uninstall microsoft c++ redistributable?
what are the decision making statements in C++? Explain if statement with an example?
Name the operators that cannot be overloaded in C++?
What is iomanip c++?
What is an inclusion guard?