4. Basic structure of C program: Structure of C program is - TopicsExpress



          

4. Basic structure of C program: Structure of C program is defined by set of rules called protocol, to be followed by programmer while writing C program. All C programs are having sections/parts which are mentioned below. Documentation section Link Section Definition Section Global declaration section Function prototype declaration section Main function User defined function definition section EXAMPLE.............. C program to compare all the sections: /* C basic structure program Documentation section */ #include /* Link section */ int total = 0; /* Global declaration and definition section */ int sum (int, int); /* Function declaration section */ int main () /* Main function */ { printf ("This is a C basic program "); total = sum (1, 1); printf ("Sum of two numbers : %d ", total); return 0; } int sum (int a, int b) /* User defined function */ { /* definition section */ return a + b; }
Posted on: Sun, 29 Sep 2013 04:07:20 +0000

Trending Topics



Recently Viewed Topics




© 2015