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
C Introduction
C Features
C Installation
C Basic Program Structure
C Comments
Features of C Language
Exercises & Assignments
No Content Found.
Interview Questions & Answers
What is C language?
What are the main features of C language?
What is the basic structure of a C program?
What is the difference between a compiler and an interpreter?
What is the difference between int main() and int main(void) in C?