write a program to input a number to check and display wheater it is an odd number or even number
Answers
Answered by
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
Math,
2 months ago
Environmental Sciences,
2 months ago
English,
5 months ago
Math,
5 months ago
Biology,
10 months ago
Political Science,
10 months ago
Biology,
10 months ago