C Program Area Of Circle

 

1.c program Area Of Circle (standard )

1)To calculate the area of circle we need radius.

2)The value of radius will store into the variable “r’.

3)By substituting the r value in the formula we will get area.

output:

 

2.c program Area Of Circle(functions)

1)We are calling the function as area(r) which is having int type of argument.

2)The called function float area(int r) will calculate the area and return the value,that return value will assigned to the variable “a”.

output:

 

3.c program Area Of Circle(pointers)

1)We are calling the function by passing references as arguments using area(&r,&a).

2)The called function area(int *r,float *a) will retrieve the values at that given addresses and calculate the area and that area value will store into the pointer variable “a”.

 

output:

 

4.c program Area Of Circle(macros)

1)area(r) is symbolic name to the expression (22*r*r)/7

2)area(r)replaced with that expression given at #define.

 

output:

 

Add a Comment

Your email address will not be published. Required fields are marked *