Structure of C Programming Language :
  • we are going to learn about the basic structure of a C program (language). A C program is divided into different parts. There are four main parts to a basic c program.


  1. Documentation section.

  2. Header File section.

  3. Constant and Global variables.

  4. Main Function.

  • So now that  introduction is out of the way, let’s jump to the main discussion. The whole “C” code follows this outline. Each code have a similar outline. Now let’s learn about each of this layer in detail.


DOCUMENTATION (Optional part)

HEADER FILE

CONSTANT AND GLOBAL VARIABLE

MAIN FUNCTION

Syntax of C Programming Language
Syntax Of C Programming Language
#include<stdio.h>
main()
{
printf("Write Here...");
getch();
return 0;
}

DOCUMENTATION SECTION.

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

Documentation Of C Language


HEADER FILE SECTION.

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

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

HEADER FILE SECTION


CONSTANT AND GLOBAL VARIABLES.

In this section, we define different constants. And that value that we define that is used in whole c program.

CONSTANT AND GLOBAL VARIABLES

MAIN FUNCTION SECTION.

Every C-program needs to have the main function. Each main function contains 2 sections. A declaration part and an Execution part. In the declaration part we declare all the variables. The execution part start with the curly brackets and ends with the curly close bracket. Both the declaration and execution section are inside the curly braces.


Syntax of C Language


EXAMPLE 

Program Code Hello Word

OUTPUT

Output Image