Structure of C program typically consists of several sections: the documentation section, linkage section, definition section, variables section, main function, and sub-program section. The documentation section provides information about the program, such as its purpose and author. The linkage section links functions from the system library to the program. The definition section defines symbolic constants used in the program. The variables section declares all variables used throughout the program. The main function is the entry point for program execution and contains executable statements. The sub-program section contains user-defined functions invoked within the main function.
Table of Contents
Structure of C program typically encompasses the following sections:

Documentation Section:
- This section presents information pertaining to the program, including its title, author, and intended purpose. Comments serve as a means to document the program effectively.
- The documentation section consists of a set of comment lines by giving the name of the programme, the Author and other details.
- The comments are of two types:
- Single line comment
- Multiple line comments.
- The single-line comment is specified by two forward slashes at the beginning.(//)
- The multiple-line comment is specified by giving (/*) at the beginning and (*/) at the end.
- The linkage section provides instructions to the compiler to link the functions from the system library. The definition section defines all the symbolic constants.
- Before using variables in a programme we have to declare them. The variables can be declared in two ways (locally, and globally). If the variable is declared outside the main function main () then it is called a global variable. These variables can be accessed by other user-defined functions also.
- The variables which are declared inside the main() are called local variables. These variables can be accessed only by the main ().
- Running the C program starts with the main function.
- The main() contains two parts like the declaration part and executable part.
- In the declaration part, we declare the variables.
- In the executable part, we write the statements that are going to be executed.
- The subprogram section contains all the user-defined functions that are called in the main function. User-defined functions are generally written after the main function.
Linkage Section:
- This section provides directives to the compiler for the purpose of linking functions from the system library, thus enabling their utilization within the program.
Definition Section:
- This section is responsible for defining all symbolic constants employed within the program.
Variables Section:
- This section encompasses the declaration of all variables utilized throughout the program.
Main Function:
- This function serves as the entry point for the program’s execution. It contains executable statements that are intended to be executed.
Subprogram Section:
- This section encompasses all user-defined functions that are invoked within the main function.
C Character Set:
- The C character set consists of letters (upper case letters, a to z), digits (0 to 9), special symbols ((), {}) and white spaces (blank space, horizontal tab, vertical tab).
- By using these character sets we can write a programme in C language.

Write a C programme to display the message “Hello, World!” and “Welcome to India”.
#include <stdio.h>
Void main()
{
printf(“Hello, World!”);
printf(“Welcome to India”);
}
Write a Programme to display the message Dennis Ritchie is the father of C language. He invented C in 972 at AT&T Bell Laboratories.
/**
* This C program converts a temperature from Celsius to Fahrenheit.
*/
#include <stdio.h>
Void main()
{
printf(“Dennis Ritchie is the father of the C language”);
printf(“He has invented C in 1972 at AT&T Bell Laboratories”);
}
Rules for Writing a C Program:
- Every executable statement must end with a semicolon.
- Every C programme must contain at least one main function ().
- For every open braces, there should be respective closing braces.
- A variable should be declared before use in the program.