Syntax of C-language

     Syntax of C-programming

                              4.
A C program is divided into different sections. There are six main sections to a basic c program. 

The six sections are,

  1. Documentation
  2. Link
  3. Definition
  4. Global Declarations
  5. Main functions
  6. Subprograms

1. Documentation:-

The documentation section is the part of the program where the programmer gives the details associated with the program. He usually gives the name of the program, the details of the author and other details like the time of coding and description. It gives anyone reading the code the overview of the code.

2.Link Section:-

This part of the code is used to declare all the header files that will be used in the program. This leads to the compiler being told to link the header files to the system libraries.


3.Definition Section:-

In this section, we define different constants. The keyword define is used in this part.


4.Global Declaration Section:-


This part of the code is the part where the global variables are declared. All the global variable used are declared in this part. The user-defined functions are also declared in this part of the code.


5.Main Function Section:-


Every C-programs needs to have the main function. Each main function contains 2 parts. A declaration part and an Execution part. The declaration part is the part where all the variables are declared. The execution part begins with the curly brackets and ends with the curly close bracket. Both the declaration and execution part are inside the curly braces.

 6.Subrogram Section:-


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

    #include<stdio.h>
    main()
    {
     
    Body parts;

      }

#:-Preprocessor -> all things do before complitation

includes:-directory

#include:-preprocess directory

main():-function

                             End

If you like this content then you can share it and for any issues you can direct contact with me from Home Page.

For regular updates you can also follow my site.

<=Back                                                       Next=>


Comments

Post a Comment

Popular posts

Creative pattern of butterfly in C-language

Program to show present time and date in C-language

Introduction of C-language.

Program to cheque enter number is a perfect number or not using if else in C-language

Program to cheque four digits number is palindrome or not in C-language

Program to print the cube of a number in c-language

Simple Hello world program in c- language