#include <stdio.h>
// Function to calculate the area of a parallelogram
float calcAreaOfParallelogram(float base, float height) {
float area;
// Calculate the area
area = base * height;
return area;
}
int main(void) {
float base, height, area;
// Input measurements
printf("Enter the base of the parallelogram: \n");
printf("Enter the height of the parallelogram: \n");
// Calculate the area
area = calcAreaOfParallelogram(base, height);
// Print the result
printf("The area of the parallelogram is: %.2f\n", area
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgovLyBGdW5jdGlvbiB0byBjYWxjdWxhdGUgdGhlIGFyZWEgb2YgYSBwYXJhbGxlbG9ncmFtCmZsb2F0IGNhbGNBcmVhT2ZQYXJhbGxlbG9ncmFtKGZsb2F0IGJhc2UsIGZsb2F0IGhlaWdodCkgewogICAgZmxvYXQgYXJlYTsKCiAgICAvLyBDYWxjdWxhdGUgdGhlIGFyZWEKICAgIGFyZWEgPSBiYXNlICogaGVpZ2h0OwoKICAgIHJldHVybiBhcmVhOwp9CgppbnQgbWFpbih2b2lkKSB7CiAgICBmbG9hdCBiYXNlLCBoZWlnaHQsIGFyZWE7CgogICAgLy8gSW5wdXQgbWVhc3VyZW1lbnRzCiAgICBwcmludGYoIkVudGVyIHRoZSBiYXNlIG9mIHRoZSBwYXJhbGxlbG9ncmFtOiBcbiIpOwogICAgc2NhbmYoIiVmIiwgJmJhc2UpOwoKICAgIHByaW50ZigiRW50ZXIgdGhlIGhlaWdodCBvZiB0aGUgcGFyYWxsZWxvZ3JhbTogXG4iKTsKICAgIHNjYW5mKCIlZiIsICZoZWlnaHQpOwoKICAgIC8vIENhbGN1bGF0ZSB0aGUgYXJlYQogICAgYXJlYSA9IGNhbGNBcmVhT2ZQYXJhbGxlbG9ncmFtKGJhc2UsIGhlaWdodCk7CgogICAgLy8gUHJpbnQgdGhlIHJlc3VsdAogICAgcHJpbnRmKCJUaGUgYXJlYSBvZiB0aGUgcGFyYWxsZWxvZ3JhbSBpczogJS4yZlxuIiwgYXJlYSk7CgogICAgcmV0dXJuIDA7Cn0K