C Program Area Of Parallelogram | C Programs

Another program in the list of C Programs – C program to find the area of parallelogram, with sample outputs and sample example code. Do check it out.

Using Standard Method

1)By calculating the area of parallelogram we need base,height .

2)We declared the variables base,height,area.

3)Substitute the values into the formula area=(base*height),then we will get area value,that will be assigned to the variable “area”.


Using Function

1)We are calling the function as area(b,h),here we are passing the b,h values as arguments.

2)The called function area(float b,float h) will calculate the area and returns the value.

3)The return value will assigned to the variable “a”.


Using Pointers

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

2)The called function will calculate the area ,which is having pointers as arguments.

3)The calculated area will assigned to the pointer variable “area’.


Using Macros

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

2)area(b,h)replaced with that expression given at #define.


Add a Comment

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