well, I' running linux, and compiling with gcc, how I tried the variables example program in the first tutorial for C programming on this website, and something funny happens when I run the program. Here is the code exactly how it is copy/pasted from the tutorial
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;
}
now when I compile this, and ./ the program, I get this...
beatzz@AMD5200:~/haxor$ ./var
Please enter a number: 22
You entered 22beatzz@AMD5200:~/haxor$
beatzz@AMD5200:~/haxor$
see how after hitting enter, after entering the number 22, it outputs the next line of code along with my usual shell prompt?
You entered 22beatzz@AMD5200:~/haxor$
why? I have tried adding in a /n after the %d in the code, to no avail. No other idea, can someone provide some simple help for a simple question?