Beta Coder

Learn code like Beta Coder.

Breaking

Tuesday, December 31, 2019

Structure of C Program

C Programming Language

C Programming for beginner


C is a general purpose, structure oriented and middle label language.
It is fully case sensitive language. It  is created at Bell Laboratory in  1972  by  Dennis Richie. It is update version of B.C.P.L. [Basic Command Programming Language ] that is nice name 'B'

Advantage:-
1. It is more reliable and Maribel  machine to machine.
2. It is easy to understand encoding.
3. It support both features, high level and low level language.
4. It is general purpose and open sourcing language.

Structure of 'C' Programming:-
1. Documentation section.
2. Linking Section.
3. Definition section.
4. Global declaration section.
5.  main() section.
     i) Declaration section.
     ii) Execution section.
6. Sub function section.
     i) Declaration section.
     ii) Execution section.

1. Documentation section.
    In the section, programmer write about the program like program name,user name,date,time etc.
    It is compile and execute by computer. It is only for future hints.

                                         Syntax:
                                                     i) Single Line
                                                         //.............................
                                                     ii) Multiple Line
                                                         /*.............................
                                                           ..............................
                                                           ...........................*/
2.Linking Section. 
   In linking section, the header files are placed in a syntax. Header file are the build in file that are   used to execute some build in function.Some header file are stdio.h, conio.h , math.h etc.

                                          Syntax:
                                                  #include <header file>
                                                                or
                                                 #include "header file name"
3. Definition section.
    In solving problem, some variable are available but these are not changeable . These are placed in the definition section.

                                        These variable are placed as:
                                                 #define pi 3.143

4. Global declaration section.
    In the section, the Global variable and function are declared. The Global variables and functions   are usable form whole of the program.

5.  main() section.
    The main() function is most  important section of any C program. It is essential to run fast.
                                   
                                        The smallest 'C' program :
                                                        main()
                                                        {
                                                        }
5-i) Declaration section.
       In the declaration section, all variable and function are declared. a  'C' program contain only one main() function.

5-ii) Execution section.
        In this section, all expression are listed.

6. Sub function section.
    If these needed some sub function, then these are placed in sub function section. It is just like         main().

Basic Structure of C Program



No comments:

Post a Comment