C++ program to calculate parallelogram area
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 <iostream>
#include <math.h>
int main() {
float parallelogramBase;
float parallelogramHeight;
std::cout << "Please enter base of parallelogram:";
std::cin >> parallelogramBase;
std::cout << "Please enter height of parallelogram:";
std::cin >> parallelogramHeight;
float areaOfParallelogram = parallelogramBase * parallelogramHeight;
std::cout << "Area of parallelogram is: " << areaOfParallelogram;
}
Output:
Please enter base of parallelogram: 22
Please enter height of parallelogram: 18
Area of parallelogram is: 396