First-program-in-C .

In this session i have discussed first program in C .


Lets see how to write the first program in C

    #include<stdio.h>
    int main()
    {
        printf("Hello World");
        return 0;
    }
    
    OUTPUT : Hello World
    

#include<stdio.h>

#include<stdio.h> this line inform the compiler to include the header file before executing the program . It is also known as preprocessor .

main() function

main() function is a function which is must in every C program. Everything inside this function in a C program will be executed. In the above example, int written before the main() function is the return type of main() function . The curly braces { } just after the main() function encloses the body of main() function. We will learn what functions are in upcoming tutorials.

printf()

The printf() function is used to print the any thing on the output screen . In my case it is print the Hello World . The header file stdio.h contains the definition of printf() functon . All header files have extension as .h

Welcome to AndroidATPoint.

back image                     next image