Closed alexwenbj closed 4 years ago
It appears that output buffering on stdout
is on by default. Different platforms will have different defaults.
There are a few solutions that all work, and the simplest is:
printf("Enter a number: ");
fflush(stdout);
scanf("%f",&f);
@andrakis Thank you.It works. BTW:Is there any way to set up this default value in jor1k?
When I compile and run this program:
The behavior is not expected: it suspend to wait for input without the output:"Enter a number:",when I input data and press enter,the "Enter a number:" and "Value = ..." output at the same line.