C++ INTRO14.CPP example from Turbo C++
#include <iostream.h>
int main ()
{
int your_number;
cout << "Enter a whole number: ";
cin >> your_number;
if (your_number % 2 == 0)
cout << "\nYour number is even\n";
if (your_number % 2 != )
{
cout << "Your number is odd.\n";
}
cout << "That's all!\n";
}
I only get the message "Enter a whole number". When I enter an odd or even number the program seems to terminate.
I get the message "your number is even" (or odd) only after I return to DOS shell.
Why do I only get partial output when I hit RUN from the IDE?