SCOPE OF FUNCTION

In this function sum, if you see we are passing value of a and b from main method , which means scope of variable a and b inside main method is only for this function.

Calling convention

this indicates two things

1.the order in which argument passing to the function.

2.which function (calling or called) perform the cleanup of variable when the control return from the function.

Using library function

1.math.h

2.sin()

3cos()

4.tan()

5.pow()

Why using math.h function we don’t need to define the prototype and body of the function because these prototype and body already define in math.h library.

#include<stdio.h>

#include<math.h>

void main()

{

  float a=0.5;

  float x,y,z,t;

  x=sin(a);

  y=cos(a);

  z=tan(a);

  t=pow(a);

  printf(“%f %f %f %f” x,y,z,t);

}