Learn C: Write your first program

This entry is part 2 of 7 in the series Learn C

Now let’s try to write the first program.

#include <stdio.h>

void main()
{
    printf("Hello World");
}

Type the above code to a text file.  Name the file as hello.c

Compile it using gcc as below:

hello

Now you have created your first C program.

Series Navigation<< Learn C: Setting up the environment
Learn C: What are the resources available on the web to learn C? >>