/* Program to check if a number is even or odd */
#include<iostream>
int main()
{
using namespace std;
int no;
cout << "Enter the integer\t";
cin >> no;
if (no%2 == 0) //if no is divisible by 2, then no is even
cout << no << " is even.";
else
cout << no << " is odd.";
return 0;
}
#include<iostream>
int main()
{
using namespace std;
int no;
cout << "Enter the integer\t";
cin >> no;
if (no%2 == 0) //if no is divisible by 2, then no is even
cout << no << " is even.";
else
cout << no << " is odd.";
return 0;
}
0 Comments:
Post a Comment