Code:
alucard@thrawn:~$ cat c.c
#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\n", this_is_a_number );
getchar();
}
alucard@thrawn:~$ gcc -o c c.c
alucard@thrawn:~$ ./c
Please enter a number: 1
You entered 1
alucard@thrawn:~$
Works for me.
I see what you're doing. You don't execute
ctest.c, you execute the program produced by
gcc. In my example the "-o c" named it "c". In yours, you got the default name, which iirc is "a.out". Try
./a.out or passing "-o outputname" to
gcc.