I've been trying to teach myself C off the website http://www.cprogramming.com/. I've come to the code which requires an input number.
Here is the code:
#include <stdio.h>
int main()
{
int this_is_a_number;
printf( "Please enter a number: " );
scanf( "%d", &this_is_a_number );
printf( "You entered %d", this_is_a_number );
getchar();
return 0;
}
However when I run this, and try to enter a number into the prompt, the command window just closes. Any help would greatly be appreciated.