C Program Area Of Rectangle | C Programs

C Program To Find Area of Rectangle – do check out the new programs from the list of C programs. You can even post your code on this site. If you came up with any new idea.

C program Area of rectangle(standard)

1)We declared the variables length,breadth,area.

2)By substituting the values into the formula area=(length*breadth),we will get value of area ahich is assigned to the variable “area”.


C program Area of rectangle(function)

1)We are using the function area(float l,float b) to calculate the area of rectangle.

2)Using the code area(l,b) we are calling the function . here area(l,b) is calling function.

3)The called function area(float l,float b) will calculate the area and return the value,that return value will assigned to the variable “a”.


C program Area of rectangle(pointers)

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

2)The called function area(float *l,float *b,float *area) will calculate the area of rectangle,which is having pointer variables as arguments.

3)The calculated value will store into the pointer variable “area”.


C program Area of rectangle(macros)

1)area(l,b) is symbolic name to the expression (l*b).

2)In the code area(l,b) replaced with that expression given at #define.


Add a Comment

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