A minimal hello world program in C looks like this :
#include <stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}
You first have to include stdio.h
which gives you access to the printf
function. Then you have to define a main
function which is the entry point of the program. The code inside the main method will run, printing “Hello World” to the console and then the program exits with code 0, meaning that it ran successfully.
As you did not mention which compiler you use, or which compilation error you get, I can’t do anything else for you.
8
solved The print formatted known as printf in my program sadly won’t run [closed]