define basic structure of c programming | Allinonetuts

Define Basic structure of C Programming

To write a C program, we first create functions and then put them together. A C program may contain one or more sections. Below the Sections are defined.

Click here: – For More C Programming Tutorials

define basic structure of c programming | Allinonetuts

 

  • Documentation Section: The documentation section consists of a set of comment lines giving the name of the program, the author and other details, which the programmer would like to use later.
  • Link Section: The link section provides instructions to the compiler to link functions from the System library.
  • Definition Section: The definition section defines all symbolic constants.
  • Global Declaration Section: There are some variables that are used in more than one function. Such variables are called global variables and are declared in the global declaration section that is outside of all the functions. This section also declares all the user-defined functions.
    • main ( ) Function Section: Every C program must have one main ( ) function section. This section contains two parts, declaration part, and executable part.
      1.   Declaration Part: The declaration part declares all the variables used in the executable part.
      2.   Executable Part:  There is at least one statement in the executable part. These two parts must appear between the opening and the closing braces. The program execution begins at the opening brace and ends at the closing brace. The closing brace of the main function section is the logical end of the program. All statements in the declaration and executable part and with a semicolon.
  • Subprogram Section: The subprogram section contains all the user-defined functions that are called in the main function. User defined functions are generally placed immediately after the main function, although they may appear in any order.

All sections, except the main function section, may be absent when they are not required.

Hope you like the Article and if there is any query regarding this article so can ask by a comment on the below comments box.
and don’t forget to give the rating to the article by click on the above stars.

Hello Viewers,
welcome to the Allinonetuts a Technical tutorial and Programming Blog Maintained by Vikas Kardam, a Web Developer and Blogger From Delhi, India.
Define Basic structure of C Programming was last modified: June 23rd, 2017 by Vikas Kardam

Leave a Reply

Your email address will not be published. Required fields are marked *