c - Why doesn't my output show up until the program exits? -


I have a simple program from the C programming book, and it should ask for two integers and then show them together Yoga. I am able to enter two numbers but the output is not visible till the very end of the program.

  #include & lt; Stdlib.h & gt; # Include & lt; Stdio.h & gt; / * Additional Programs * / Main () {int integer 1, integer 2, yoga; Printf ("Enter the first integer \ n"); Scanf ("% d", and integer1); Printf ("Enter second integer \ n"); Scanf ("% d", and integer2); Sum = integer1 + integer2; Printf ("sum% d \ n", sum); Return 0; }  

The output looks like this:

  Enter the first integer 6 6 Enter the second integer number 8  

Thanks any help would be greatly appreciated, thanks!

It is possible that the output is not being automatically flavored After fflush (stdout) can be added and see if it is helpful.

Which environment are you using to create and run this program?


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -