programming-examples/c++/_Basic/Odd or Even.cpp

19 lines
304 B
C++
Raw Normal View History

2019-11-15 12:59:38 +01:00
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int n;
cout << "Enter an integer: ";
cin >> n;
if ( n%2 == 0)
{
cout << n << " is even.";
}
else
{
cout << n << " is odd.";
}
getch();
}