Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip> // for constant
- using namespace std;
- int main()
- {
- double inputHeight, inputLength, outputArea; // basic math
- const double ONE_HALF = .5; // to multiply base and height by
- cout << "Input the height of the right triangele: ";
- cin >> inputHeight;
- cout << "Input the length of the right triangele: ";
- cin >> inputLength;
- outputArea = ONE_HALF*(inputHeight*inputLength);
- cout << '\n' << "The area of the right triangle is: " << outputArea;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement