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

Explain the difference between C and C++.

1 Answers   Accenture,


Write a C++ Program to Find Sum and Average of three numbers.

1 Answers  


How can a C function be called in a C++ program?

0 Answers  


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

1 Answers  


Explain about Searching and sorting algorithms with complexities

0 Answers   Accenture,


To solve the 8 Queens problem, which algorithm is used?

0 Answers   Accenture,


How to delete array of objects in C++? Proof by C++ code for proper deletion

0 Answers  


Write a program to generate the Fibonocci Series in C++.

0 Answers   Accenture,


Identify the error in the following program. include<iostream> using namespace std; void main() { int num[]={1,2,3,4,5,6}; num[1]==[1]num ? cout<<"Success" : cout<<"Error"; }

1 Answers  


When would you use a pointer? A reference?

0 Answers   Amazon,


What is function overloading and operator overloading in C++?

0 Answers   IBS, TCS,


How do you write a function that can reverse a linked-list in C++?

0 Answers   IBS,


Categories