Posts

Showing posts with the label Basic structure of c program

Basic structure of C program

Image
Basic structure of C program : The examples discussed so far illustrate that a C program can be viewed as a group of building blocks called functions. A function is a subroutine that may include one or more statements designed to perform a specific task. To write C program, we first create functions and then put them together. A C program may contain one or more sections as following : 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. The link section defines all symbolic constants. 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 use-defined functions. Every C program must have one main() function section. This section contains two parts, d...