1. C – Hello World

#include<stdio.h>

int main() //Note - you can use "void main" too.
{
    printf("Hello World");
    return 0; // you don't need "return 0" if using "void main"
}


using “void main()” instead of “int main”

Every book or tutorial always starts with “int main” to teach us that a method can return values – which we will see in later sections.

#include<stdio.h>

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

}

Output:

%d bloggers like this: