c logo

Structure of C Programming

Structure of C Programming

1 :- Each program begins with preprocessor directives that serve to provide information about functions from standard libraries and definitions of necessary program constants.

2 :- Every C program consists of one or more functions. Function is a self contained block of program which performs some kind of task.

3 :- Every C program begins with main() function. Every function has a return value.

4 :- For Example, consider the following program which gives summation of x and y as z.

structure

#include<stdio.                                                      /*Preprocessor Directive*/

int sum(int,int); /*Function prototype for sum()*/

int a,b,c; /*Global Variables*/

float d; /*Global Variable*/

int main() /*main() function with return type*/

{

int x, y; /*Local variables to main()*/

int z;

char ch;

z=sum(x,y); /*Function call*/

}

int sum (int x1, int y1) /*Definition of function sum()*/

{

return(); /*return value of function sum*/

}


Now Friends If you like this post please tell us how can we help you to provide better knowledge?

If this post is use full for you please share the post with your friends.

Please follow as Facebook : www.facebook.com

Please follow as Twitter : www.twitter.com

And More Information Please Visit Here : www.weindians.in

Please Subscribe on Youtube : www.youtube.com

Leave a Reply

Your email address will not be published.

%d bloggers like this: