C Program Structure Explain With Details Part 2

Structure Of C Programming Language Explain With Structure 2
Get Our Latest Interview Questions: Aptitude, Reasoning, English, GD, HR-PI


In Previous Post We Learn Up to Link Section Now Next Section Would Be:

Definition Section: 
In this section we define all the symbolic constant. mainly we use this section with function or structure programming.
For Ex: #define PI 3.14 /*definition section*/

Global Declaration Section: 
In this section we can define variables as well as users define functions. The variables which we define under this section is known as global variable, which means that this type of variable is used in more then one function. 
For Ex: int add(int a, int b); - this I am going to explain in 3rd chapter. 

Main Function:
Every c program must have 1 main function section. Because in c program start execution from main function ex: main(). If we write more then one main function in a single c program then compiler or interpreter got confused for where to start execution.  
Main Function Consist of 2 parts:                     
1. Declaration Part.                                           
2. Executable Part.

Declaration Part: 
Here we declare all the variables used in executable part. There is at least one statement  in the executable part. These two parts must appear between opening and closing braces.  
For Ex: int a,b;

Executable Part: 
In this part we write our instructions what we have to do. 
For Ex: if we have to print some message then: Printf(“Welcome to Sonali - Technical Programming”); 

Sub Program Section: 
This section defines all the use defined function for different – different work. 
For Ex:  
add()           
{  
    c=a+b; 
    print f(“%d,c”);   

Subtract()      

    c=a-b; 
    print f(“%d,c”);   
}

Expert Review: Structure of c program here completed if you have any query then please comment on our Facebook comment box by login with your Facebook account. i hope you can understand this very easily.

 Enter Your Email Address To Get Our Latest Programming Updates In Your Mail / Subscribe Our Updates In Your Mail:

Search Keyword:  Comp. Jobs, 2014 Jobs, Comp. Openings, Software Job In Comp., Technical Interview Questions, Programming Questions, What Is Programming, Learn Online Programming, Online Programming Tutorials, Online Programming, Programming Tutorials For Beginners, Easy Step To Start Coding

Labels: