Create a program that will ask the user to input an integer and intify the integer is an odd or even.
#include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter an integer: ";
cin >> n;
if ( n % 2 == 0)
cout << n << " is even.";
else
cout << n << " is odd.";
cin >> n;
return 0;
}
Comments
Leave a comment