A Program to Find the Area of a Parallelogram

In this example, we are giving a program to find the area of a parallelogram. The rule of finding the area of a parallelogram is: A = base * vertical_height.


Program to find the area of a parallelogram:

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main() {
  4. float b, h, area;
  5. printf("Enter the value of base and height: ");
  6. scanf("%f %f", &b, &h);
  7. area = b * h;
  8. printf("Area of parallelogram: %.2f", area);
  9. return 0;
  10. }

Output:

Enter the value of base and height: 3, 4
Area of parallelogram: 12.00