Computer Science, asked by SnehilPrasad, 8 months ago

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 Anonymous
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 deviharicharan
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