If I try to run the following simple code under Cygwin on Windows 7,
#include
int main() {
int i1, i2, sums;
printf( \"Enter first integer
you can try for disabling the buffering in stdout by using
setbuf(stdout, NULL);
It seems that the output of your program is buffered. Try enabling line buffering explicitly:
setlinebuf(stdout);
Like @thejh said your stream seems to be buffered. Data is not yet written to the controlled sequence.
Instead of fiddling with the buffer setting you could call fflush
after each write to profit from the buffer and still enforce the desired behavior/display explicitly.
printf( "Enter first integer\n" );
fflush( stdout );
scanf( "%d", &i1 );