Write a C++ Program to Find whether given Number is Odd or Even.
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 |
What kind of problems does name mangling cause?
Write a program to read two numbers from the keyboard and display the larger value on the screen
Write a program that can take input from 3 to 8 and calculate the average?
dynamic scoping is
What is bool in C++
Tell us the size of a float variable.
Tell me about virtual function
explain the term 'resource acquisition is initialization'?
Implement a 2D bit-matrix representing monochrome pixels which will have only OFF/ON values and will take on an average only one bit of memory for each stored bit. How to perform various operations on it?
Briefly explain various access specifiers in C++.
Consider the following C++ program
what do you mean by exception handling in C++?