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.

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


Please Help Members By Posting Answers For Below Questions

Why multiple inheritance is not possible?

1026


Why cstdlib is used in c++?

1001


Which c++ operator cannot overload?

936


What is the difference between a type-specific template friend class and a general template friend class?

941


What are different types of loops in c++?

1082


What is implicit pointer in c++?

1042


What is object and class in oops?

1009


What is rvalue?

1093


Explain virtual class?

976


Why can’t you call invariants() as the first line of your constructor?

975


What language is a dll written in?

983


What are libraries in c++?

1023


Describe the process of creation and destruction of a derived class object?

1077


What is the main purpose of overloading operators?

1076


Can a constructor return a value?

1172