The desired program output is as follows:Code:#include <stdio.h> #define WAIT system("sleep 2") main() { printf("Helllo\n"); WAIT; }
1)Program prints the "Hello" msg
2)It halts for 2 seconds
3)It finally exits
But if we write something like:
(\n character ommited)Code:printf("Hello"); WAIT;
then the output changes:the program first halts and
then prints the msg.
Is there anybody out there that happens to know why this happens?