write a c++ program to enter the value and check whether the number is even or odd
Answers
Answered by
1
Answer:
#include<iostream.h>
#include<conio.h>
int main()
{
int a;
cout<<"ent a value \n" ;
cin>>a;
if(a%2==0)
cout<<"the number is even" ;
else
cout<<"the number is odd" ;
getch() ;
}
Explanation:
HOPE IT HELPS YOU
DO FOLLOW FOR MORE PROGRAMS
MARK AS BRAINLIEST
Answered by
2
Question:-
- Write a c++ program to enter the value and check whether the number is even or odd.
Program:-
#include<iostream.h>
using namespace std;
int main()
{
int n;
cout<<"Enter a number: ";
cin >> n;
if (n%2==0)
cout<<"Number is even. ";
else
cout<<"Number is odd.";
return 0;
}
}
Similar questions