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

What is the use of :: operator in c++?

1184


Which is better turbo c++ or dev c++?

1127


What is exception handling? Does c++ support exception handling?

1083


Please explain the reference variable in c++?

1129


Why is c++ not purely object oriented?

1061


Is empty stack c++?

1057


What does sksksk mean in text slang?

2180


What is basic concept of oop?

1221


Is there a c++ certification?

1102


Why is the function main() special?

1144


Explain what happens when an exception is thrown in C++.

998


What is an advantage of polymorphism?

1136


What is the difference between new() and malloc()?

2222


How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?

1127


What is c++ prototype?

1308