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:
#include <iostream>#include <cmath>using namespace std;int main() {float b, h, area;cout << "Enter the value of base and height: " << endl;cin >> b >> h;area = b * h;cout << "Area of parallelogram: " << area;return 0;}
Output:
Enter the value of base and height: 3, 4 Area of parallelogram: 12.00