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
help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase
What is constructor overloading in oop?
How one would use switch in a program?
What is c++ namespace?
What is a virtual function in C++?
What does extern mean in a function declaration in c++?
What are the differences between malloc() and calloc()?
What are the characteristics of friend functions?
C is to C++ as 1 is to a) What the heck b) 2 c) 10
What is encapsulation in oops?
What is the function to call to turn an ascii string into a long?
What is the difference between public, private, and protected access?
What are pointer-to-members in C++? Give their syntax.
Why do we use polymorphism in oops?
What is the first name of c++?