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 |
Write a syntax and purpose of switch statement.
Write a program to display the following output using a single cout statement Maths=90 Physics=77 Chemistry = 69
What is a COPY CONSTRUCTOR and when is it called?
What is partial specialization or template specialization?
Write a program that ask for user input from 5 to 9 then calculate the average
what is a pragma in C++?
What is an abstract class in C++
0 Answers SwanSoft Technologies,
dynamic scoping is
What is Advantage and Use of THIS pointer in C++ – Scenarios?
What kind of problems does name mangling cause?
What is Boyce Codd Normal form?
Briefly explain various access specifiers in C++.