Write a program that reads an integer and determines and prints whether it is odd or even. [Hint: Use the remainder operator. An even number is a multiple of two. Any multiple of two leaves a remainder of zero when divided by 2.].
#include <iostream>
using namespace std;
int main(){
int number;
cout<<"Ente the number : ";
cin>>number;
if(number%2==0){
cout<<"The numbe is even\n";
}else{
cout<<"The numbe is odd\n";
}
system("pause");
return 0;
}
Comments
Leave a comment