#include "iostream"
using namespace std;
void main() {
int number;
cout << "Enter an integer: ";
cin >> number;
if ( number % 2 == 0)
cout << number << " is even.";
else
cout << number << " is odd.";
}
Output
using namespace std;
void main() {
int number;
cout << "Enter an integer: ";
cin >> number;
if ( number % 2 == 0)
cout << number << " is even.";
else
cout << number << " is odd.";
}
Enter an integer: 24
24 is even.
24 is even.
0 Comments
if you have any doubt in programming concept please let me know