fbpx

WHAT IS A STRUCTURE OF A C PROGRAM?

A   ‘C’ program basically consists of the following parts :

 

  • Preprocessor  commands

  • Functions

  • Variables

  • Statements & Expressions

  • Comments

 

Let us take a look at the various parts of the above program :

  • The first line of the program #include is a preprocessor command. Which tells a C  compiler to include stdio.h file before going to actual compilation.

 

  • The next line int main() is the main function where the program execution begin.

 

  • The next line int a = 10; is the place where we are intializing a value in to a variable and also explaining that which type of data we are storing ina variable.

 

  • The next line printf(……….)  is another function available in C which causes the to print the value we have given in a variable.

 

  •  The next line  return 0;  terminates the main() function and returns the value 0.