Wednesday 23 January 2008

Function in c with parameter and returning a value.

void main(){int a=1,b=5,c;clrscr();c=operation(a,b);printf("%d",c);getch();}int operation(int a,int b){int c;c=++a * ++a * b++;return c;}Output: 45Note. Any function can return only one value at a time. If return type is int then there is not necessity of function declaration.

No comments:

Post a Comment