Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a C++ Program to Find whether given Number is Odd or Even.



Write a C++ Program to Find whether given Number is Odd or Even...

Answer / 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

More C++ Interview Questions

Difference between function overloading and function overriding.

0 Answers   Alter,


What are the costs and benefits of using exceptions?

0 Answers   Amazon,


What is RTTI and why do you need it?

0 Answers   Amazon,


How to input string in C++

0 Answers  


What is Advantage and Use of THIS pointer in C++ – Scenarios?

0 Answers  


Do you know about Agilent PRECOMPILERS. ?

0 Answers   Agilent,


C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.

0 Answers  


Write a C++ Program to find Square Root of a number using sqrt() function.

1 Answers  


Find the Factorial of a number using a program.

0 Answers   Accenture,


What is the difference between virtual functions and pure virtual functions?

1 Answers  


Without using third variable write a code to swap two numbers.

0 Answers   Accenture,


What is an abstract class in C++

0 Answers   SwanSoft Technologies,


Categories