C Program to Find the Area of Parallelogram

devquora
devquora

Posted On: Jan 26, 2023

C Program to Find the Area of Parallelogram

 

Overview:

Here, First of all, I would like to explain the term “ area ”  as the region occupied inside the boundary of a flat object or figure. Then,  I I want to introduce you to the Geometric Shape Parallelogram and explain What do you mean by area of a Parallelogram . Moreover, I will demonstrate how to find the area of a Parallelogram? Furthermore, I will write a logic and c program to find the area of Parallelogram with output. After all, I will explain the resultant output.

Table of contents:

  1. What are the characteristics of quadrilateral?
  2. What is a Parallelogram?
  3. What are the properties of the Parallelogram?
  4. What do you mean by the area of a Parallelogram?
  5. Demonstration how to find area of a Parallelogram
  6. Main Logic to find the area of a Parallelogram
  7. C Program to Find the Area of Parallelogram
  8. Conclusion

What are the characteristics of quadrilateral?

The word Quadrilateral is derived from the two latin words quad and lateral which means four and sides respectively.  A Quadrilateral has four-sides, it is 2-dimensional (a flat shape), closed (the lines join up), and has straight sides.

What is a Parallelogram ?

A parallelogram is a special type of quadrilateral that has equal and parallel opposite sides.

A parallelogram ABCD has 4 edges such as AB, BC, CD, DA on which AB parallel to CD and AD parallel to BC.

Also, AD = BC and AB = CD.

What are the properties of the Parallelogram ?

The properties of Parallelogram are given below:

  1. Diagonals of a parallelogram divides each other in two equal half.
  2. Opposite sides of a parallelogram are parallel and equal in length.
  3. Opposite angles of a parallelogram are equal.
  4. The sum of any two adjacent angles of a parallelogram are 180 degrees.
  5. Sum of all interior angles equal to 360 degrees.

What do you mean by the area of a Parallelogram ?

Base is any side of a parallelogram. Height is the perpendicular distance between the base and it's opposite side.

The area of a parallelogram can be calculated by multiplying Base and Height.

Area of Parallelogram = B X H

Where,

B is the length of the base of a parallelogram.

H is the length of height of parallelogram.

The Base and the Height are perpendicular on each other.

Demonstration how to find area of a Parallelogram

Parallelogram  Area

Main Logic to find the area of a Parallelogram

  1. Declare 3 variables.
  2. Accept values of base and height from the user.
  3. Apply The formula, Area of parallelogram = base X height.
  4. Print the value of Area.

C program to find area of Parallelogram

/*
* C Program to calculate area of Parallelogram 
*/
#include 
#include 
 
int main(){
    float base, height, area;
    printf("Enter the base and height parallelogram\n");
    scanf("%f %f", &base, &height);
    /* Area of parallelogram = base X height */
    area = base * height;
    printf("Area of parallelogram : %0.4f\n", area);
     
    getch();
    return 0;
}

The output of the Program:

Enter the value of base: 5

Enter the value of height: 3.5

Area of parallelogram : 17.5000

Area of Parallelogram  Output

Conclusion

Above program first takes the length of base and height from the user using the scanf function and stores it in three floating point variables. Then it calculates the area of Parallelogram using the formula Area of parallelogram = base X height. Then, it prints the area of the parallelogram on screen using printf function.

    Please Login or Register to leave a response.

    Related Articles