Basic Structure of C programs

Hey Friends, so far we have learned about some basic things of C programming language like ( Variable, Constant, Keywords, etc. ) Now today we are going to learn about the basic structure of c programming. So let’s begin..!!!

Basic Structures of C programs 

Basically, any c program is divided into 6 different sections. These Six Sections are:-

1. Documentation Section
2. Link Section 
3. Definition Section 
4. Global Declaration Section 
5. Main() Function Section 
6. Subprograms Section

Below you find a brief information on them.

Basic Structure of C programs

Documentation Section

In the Documentation Section, the Programmer gives the information (Details) about the program, author, coding details, and some other stuff that is used on it. Documentation Section helps anyone (user, programmer, author, owner, etc)  to get an overview of the program.



* File Name: Helloworld.c

* Author: Suresh Mishra

* Date: 24/08/2020

* Description: a program to display hello world


Link Section 

Link Section is a part of code that is used to add or insert-header files that will be used on the program. This section tells the compiler to link header files from the system libraries.


#Include <stdio.h>

Definition Section 

In this section, we define the different constant. And also keywords as well.


#define PI=3.14

Global Declaration Section 

In this Section, Global variables are declared. All the Global Variable which is used on the program are declared in the global declaration section.


int a=7 b= 10, float z = 7.10 etc

Main Function Section 

Every C program it is necessary to have the main function. Each Main Function contains 2 parts. 1. Declaration Part and 2. Execution Part. The declaration part is the part where all the variables are declared. And the execution part always starts with curly brackets and end with curly brackets. Both the part must have inside the curly brackets.

void main ()
Int a = 10;
printf(“%d”, a);  
return 0;

Subprograms Section 

All the user-defined functions are defined in this section of the program.


int add(int a, int b)
return a+b;

In this tutorial, we learn about the basic structure of C programming. If you find any mistakes on it. Or if you have any quarry related to it please comment below. Follow us for more programming tutorials.

You May Also Like 


Post a Comment

Like us on facebook

blogger templatesblogger widgets

Follow on Twitter



Contact Form


Email *

Message *

Mad About Computer. Powered by Blogger.