Write a program to accept a number as input and check whether the number is Odd or Even
this is from computer application ,plzz help:)
Answers
Answered by
2
Answer:
To get your answer see below
Explanation:
Program to Check Even or Odd
In the program, the integer entered by the user is stored in the variable num . Then, whether num is perfectly divisible by 2 or not is checked using the modulus % operator. If the number is perfectly divisible by 2 , test expression number%2 == 0 evaluates to 1 (true).
Answered by
1
Answer:
see the explanation
Explanation:
int main(){
int a;
cin>>a;
if(a%2==0){
cout<<"The number is even";}
else{
cout<<"The number is odd";
}
return 0;
}
Similar questions
India Languages,
4 months ago
Math,
4 months ago
English,
4 months ago
English,
8 months ago
Math,
1 year ago
Business Studies,
1 year ago