Computer Science, asked by ashitiru884, 5 months ago

write a program to input a number to check and display wheater it is an odd number or even number

Answers

Answered by dhruvsh
0

Answer:

I'm gonna write the program in C++, the logic remains the same if you would like to write this down in any other language.

#include<iostream>

using namespace std;

int main( )

{ int num;

cout<<"Enter a number : "<<endl; cin>>num; cout<<endl

if num%2==0

cout<<"The number entered is even.";

else

cout<<"The number entered is odd.";

return 0;

Similar questions