Write a C++ Program to Find whether given Number is Odd or Even.
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 |
CDPATH shell variable is in(c-shell)
Explain about Searching and sorting algorithms with complexities
Can we use THIS Pointer in static function – Reason in C++?
Explain encapsulation in C++.
Consider the following C++ program
dynamic scoping is
When would you choose to return an error code rather than throw an exception?
What is the difference between malloc, calloc and realloc?
Question on Copy constructor.
How does free know the size of memory to be deleted
What's the value of the expression 5["abxdef"]?
What is a class in C++?
1 Answers Amazon, TCS, UGC Corporation,