#include
int main() {
int n, s, i;
do {
printf(\"n= \"); // here is the problem ?
scanf(\"%d\", &n);
} while (n<10
printf
doesn't print to screen unless buffer is flushedLooks like your streams are buffered. Data you write to stdout
and other streams is buffered and all output once you flush your buffer. This allows for better performance as IO is slowest among all your CPU operations.
At this point, you have at least these options:
fflush( stdout )
every time you use printf
setbuf(stdout, NULL);
\n
at end of printf
string Ex: printf("n= \n");
Your code worked in some environments probably because buffering is disabled there.