What is the basic structure of a C program?

A C program has header files, a main() function, and statements inside it. The execution starts from main().

#include <stdio.h>

int main(void) {
    printf("Hello\n");
    return 0;
}

Output:

Output of the above program is

Hello

#include adds a header, printf() prints the text, and return 0 tells the system that the program finished well. See Basic Program Structure.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.