I am not sure why my program is not showing "Hello World". I am trying by executing only printf(). Is there anything I am missing here?
Below is my complete program
#include <stdio.h>
int main()
{
printf("Hello World");
return 0;
}
My guess is that the console window which contains the output flashes by so quickly that you don't have time to see it. You need to put in something to halt the program so you can see the output. One way of doing it is to ask the user to press the Enter key.
Something like
#include <stdio.h>
int main(void)
{
printf("Hello World\n");
printf("Press the Enter key to continue\n");
(void) getc(stdin);
return 0;
}
\nat the end of the printf statement.fflush(stdout)after the current printf.