Hi
I am just starting out using cprogramming.com's tutorials. This is my second program, it is supposed to get a number by the user then say the number back.
Pretty simple, it is almost a carbon copy of the given code, it compiles but it does not run.
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;
}
I am using gcc on Mageia to compile, all I do is open up a terminal write "gcc Reading_numbers.c" in the teminal and press enter. It instantly spits out a file called a.out. That is the beginning of the trouble, I don't know what to do next to get it to work. I know that something I am doing is wrong but I am clueless, I have looked at other people's problems but cannot seem to find one that will help me