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

CDPATH shell variable is in(c-shell)

0 Answers   Siemens,


Explain about Searching and sorting algorithms with complexities

0 Answers   Accenture,


Can we use THIS Pointer in static function – Reason in C++?

0 Answers  


Explain encapsulation in C++.

0 Answers   Verifone,


Consider the following C++ program

0 Answers  


dynamic scoping is

0 Answers   Siemens,


When would you choose to return an error code rather than throw an exception?

0 Answers   Amazon,


What is the difference between malloc, calloc and realloc?

0 Answers   Alter,


Question on Copy constructor.

0 Answers   Alter,


How does free know the size of memory to be deleted

0 Answers  


What's the value of the expression 5["abxdef"]?

0 Answers  


What is a class in C++?

1 Answers   Amazon, TCS, UGC Corporation,


Categories