Hello, World
Here is a simple "Hello World" program in C:
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
Steps to Compile and Build
Save the code: Save the above code in a file named
hello.c.Open a terminal: Navigate to the directory where
hello.cis saved.Compile the code: Use the
gcccompiler to compile the code. Run the following command:gcc -o hello hello.cRun the executable: After compilation, an executable file named
hello(orhello.exeon Windows) will be created. Run it using:./hello
This will output:
Hello, World!
Last modified: 01 January 2025