logo image

C Language program to calculate parallelogram area

Views: 20

In this tutorial i will show you how to calculate parallelogram area. This program gets parallelogram base and height from user and calculates area and prints it using following formula Area = base X height

#include <stdio.h>

int main(void) {
	float parallelogramBase;
	float parallelogramHeight;

	printf("Please enter base of parallelogram:");
	scanf("%f", &parallelogramBase);

	printf("Please enter height of parallelogram:");
	scanf("%f", &parallelogramHeight);

	float areaOfParallelogram = parallelogramBase * parallelogramHeight;

	printf("Area of parallelogram is: %f", areaOfParallelogram);
}

Output:

Please enter base of parallelogram: 11
Please enter height of parallelogram: 13
Area of parallelogram is: 143.000000