Calling and Called function & Actual and formal parameters

Let us take an example:

main() //  Here main()---> Calling Function because it is calling calsum

{

int a,b,c,sum; //------> Actual Parameters

printf("Enter values of a, b & c");

scanf("%d %d %d",&a,&b,&c);

sum=calsum(a,b,c);

printf("Sum = %d",sum);

}

calsum(x,y,z) //x,y,z-----> Formal parameters, calsum ---> Called Function

{                          // because it is called by some other function

int d;

d=x+y+z;

return(d);

}

 

Leave a Reply

Your email address will not be published.