Every C program is basically a group of different section that is used for different purpose. The structure gives us a basic idea of the order of the sections in a program. A well-defined structured layout makes program more readable, easy to modify, consistent format and gives better clarity and the concept of a program. Whenever we write a program in ‘C’ language, we can divide that program into six different sections. These sections are as follows:
- Documentation section
- Linkage section
- User definition section
- Global declaration section
- Main() function section
- Subprogram section
Pictorial Representation of Basic Structure of C Programming:
Figure: Basic Structure of C Program
A program in ‘C’ may not contain all the sections shown above but main() function is a must as the program execution always starts with main() .
Brief explanation of each section is given below:
Documentation Section:
Documentation section is generally description of program. It is only a set of comments for program documentation. Documentation section consist program’s name, objective of the program, author’s name and other useful details like the creation date, title etc that can be referenced later. It provides an overview of the program.
Example
/*
Author: Eliza Begum
Date: 2/2/2022
Description: This program calculate simple interest
*/
Linkage Section:
The linkage section consists of the header files that are used in the program. It provides instruction to the compiler to link function from the system library. If the programmer wants any one of the functions, from any one of the header files, there should be a mechanism to inform the compiler. From the link section, we instruct the compiler to link those header files from the system libraries, which we have declared in the link section in our program.
Example:
#include<stdio.h>
#include<conio.h>
#include<string.h>
User Definition Section:
This section is used to define symbolic constants. Symbolic constants are used for better understanding of certain names that are not going to change throughout the program. Generally capital letter is used to define symbolic constants. The keyword define is used in this part. Macros are used in this section.
Example:
#define PI 3.1415
#define MAX 5
Here, PI, MAX are symbolic constants.
Global Declaration Section:
The global variables that can be used anywhere in the program are declared in global declaration section. Global variables can be used by all the functions. The user-defined functions are also declared in this part. The user defined functions specified the functions specified as per the requirements of the user.
Example:
int sum(int x,int y);
int a;
float b;
Main() Function Section:
The main() function has control over the program. Every C program must have a main function which is the starting point of the program execution. It contains 2 parts, namely, local variable declaration part and Executable statement part and these two parts must be written in between opening and closing braces. Local variable declaration part is used for declaring local variables which are to be used in executable statement part. Executable statement contains all the instructions to be executed.
int main()
{
int a=5; // Declaration Part
printf(“a=%d”,a); /*Execution Part */
return 0;
}
Sub Program Section:
The subprogram section contains all the user defined functions that are used to perform a specific task. All the function subprograms are user defined with an optional list of arguments enclosed in parentheses and generally placed after the main() definition is over. There can be placed in any order.
int sum(int a, int b)
{
return a+b;
}
Great line up. We will be linking to this great article on our site. Keep up the good writing.
Someone essentially help to make seriously posts I would state. This is the very first time I frequented your website page and thus far? I amazed with the research you made to create this particular publish amazing. Fantastic job!
There is apparently a lot to identify about this. I consider you made certain nice points in features also.
Its superb as your other articles : D, thankyou for posting. “In the spider-web of facts, many a truth is strangled.” by Paul Eldridge.
I like this post, enjoyed this one appreciate it for posting.
Normally I don’t read article on blogs, but I wish to say that this write-up very pressured me to check out and do it! Your writing taste has been surprised me. Thank you, very nice post.
Just wanna comment that you have a very decent internet site, I love the design it really stands out.
An impressive share, I simply given this onto a colleague who was doing a little bit evaluation on this. And he in reality bought me breakfast because I discovered it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to debate this, I really feel strongly about it and love studying extra on this topic. If attainable, as you develop into experience, would you thoughts updating your blog with more details? It is highly useful for me. Huge thumb up for this weblog post!
I really appreciate this post. I¦ve been looking all over for this! Thank goodness I found it on Bing. You’ve made my day! Thx again
Hello there, I found your blog via Google while searching for a related topic, your web site came up, it looks good. I have bookmarked it in my google bookmarks.
I’m really inspired along with your writing skills as well as with the format to your weblog. Is that this a paid subject or did you customize it your self? Either way stay up the excellent high quality writing, it’s rare to peer a nice weblog like this one nowadays..
Super-Duper blog! I am loving it!! Will be back later to read some more. I am taking your feeds also
You made some first rate factors there. I looked on the internet for the problem and located most people will go together with together with your website.
Your place is valueble for me. Thanks!…
I am not really excellent with English but I find this very easygoing to translate.
Thank you for some other informative website. The place else may I get that type of information written in such an ideal method? I’ve a venture that I am just now working on, and I have been at the look out for such information.
I believe this internet site contains very great written subject matter posts.
Hello very nice blog!! Guy .. Excellent .. Amazing .. I’ll bookmark your web site and take the feeds also?KI am glad to search out so many helpful information here in the put up, we want work out more strategies in this regard, thank you for sharing. . . . . .
I don’t usually comment but I gotta tell regards for the post on this special one : D.
I just could not depart your website before suggesting that I really enjoyed the usual info an individual supply on your visitors? Is gonna be back often in order to investigate cross-check new posts.
Real excellent visual appeal on this internet site, I’d value it 10 10.
Hello! I just would like to give a huge thumbs up for the great info you have here on this post. I will be coming back to your blog for more soon.
magnificent publish, very informative. I ponder why the opposite specialists of this sector don’t realize this. You must continue your writing. I am sure, you’ve a great readers’ base already!
Super-Duper blog! I am loving it!! Will be back later to read some more. I am bookmarking your feeds also.
Thank you for any other informative site. The place else may just I get that type of information written in such an ideal manner? I’ve a undertaking that I’m just now operating on, and I have been on the look out for such information.
I have been absent for some time, but now I remember why I used to love this web site. Thanks , I¦ll try and check back more frequently. How frequently you update your web site?
I’ve been surfing online greater than 3 hours lately, but I by no means found any attention-grabbing article like yours. It’s beautiful price sufficient for me. Personally, if all web owners and bloggers made just right content as you did, the web shall be a lot more helpful than ever before.
I do accept as true with all of the ideas you’ve presented to your post. They’re really convincing and will certainly work. Still, the posts are too short for beginners. May you please extend them a little from subsequent time? Thank you for the post.
Fantastic items from you, man. I have have in mind your stuff prior to and you’re just extremely great. I really like what you’ve received right here, really like what you are saying and the way in which wherein you say it. You make it enjoyable and you continue to care for to keep it smart. I cant wait to read far more from you. This is really a terrific site.
It¦s actually a great and helpful piece of info. I¦m satisfied that you simply shared this helpful information with us. Please keep us up to date like this. Thanks for sharing.
I like this website because so much utile material on here : D.
I?¦ve been exploring for a little for any high quality articles or weblog posts on this sort of area . Exploring in Yahoo I eventually stumbled upon this web site. Studying this information So i?¦m happy to show that I’ve an incredibly excellent uncanny feeling I found out just what I needed. I most definitely will make sure to do not put out of your mind this site and give it a glance regularly.
Simply wish to say your article is as surprising. The clarity in your post is just excellent and i can assume you are an expert on this subject. Fine with your permission let me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please keep up the rewarding work.
Real great info can be found on web site.
I have been exploring for a bit for any high quality articles or blog posts on this sort of area . Exploring in Yahoo I at last stumbled upon this web site. Reading this info So i’m happy to convey that I’ve an incredibly good uncanny feeling I discovered just what I needed. I most certainly will make certain to do not forget this site and give it a glance regularly.
This site is my intake, very fantastic design and style and perfect content material.
Virtually all of the things you point out is supprisingly appropriate and it makes me wonder why I had not looked at this in this light previously. This particular piece truly did turn the light on for me personally as far as this subject goes. However there is actually one factor I am not too comfy with and whilst I make an effort to reconcile that with the actual core theme of the point, allow me see just what the rest of your subscribers have to point out.Nicely done.
I like your writing style really loving this website .
Your style is so unique compared to many other people. Thank you for publishing when you have the opportunity,Guess I will just make this bookmarked.2
You are my breathing in, I possess few web logs and rarely run out from to post .
I am not rattling wonderful with English but I get hold this real easy to translate.
I am glad to be a visitant of this consummate blog! , regards for this rare information! .
As soon as I discovered this website I went on reddit to share some of the love with them.
I really appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thanks again
Thanks for sharing superb informations. Your website is very cool. I am impressed by the details that you have on this site. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, my friend, ROCK! I found simply the info I already searched everywhere and simply could not come across. What an ideal web-site.
Some genuinely interesting points you have written.Aided me a lot, just what I was looking for : D.
It is truly a nice and useful piece of info. I?¦m happy that you shared this useful info with us. Please keep us up to date like this. Thank you for sharing.
I’m impressed, I need to say. Actually rarely do I encounter a weblog that’s each educative and entertaining, and let me let you know, you could have hit the nail on the head. Your thought is excellent; the issue is one thing that not sufficient persons are talking intelligently about. I am very blissful that I stumbled across this in my search for one thing regarding this.
Hiya, I am really glad I’ve found this info. Nowadays bloggers publish only about gossips and web and this is actually annoying. A good web site with exciting content, this is what I need. Thank you for keeping this web-site, I’ll be visiting it. Do you do newsletters? Can not find it.
This is the right blog for anyone who wants to find out about this topic. You realize so much its almost hard to argue with you (not that I actually would want…HaHa). You definitely put a new spin on a topic thats been written about for years. Great stuff, just great!
I am really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you customize it yourself? Either way keep up the nice quality writing, it is rare to see a great blog like this one nowadays..
I think you have remarked some very interesting points, regards for the post.
Very good written story. It will be valuable to anyone who utilizes it, as well as me. Keep up the good work – for sure i will check out more posts.
Utterly composed subject material, Really enjoyed reading through.
Very interesting details you have remarked, regards for posting. “I don’t know what you could say about a day in which you have seen four beautiful sunsets.” by John Glenn.
I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.