MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / main

Function main

Lab_01/10_right_triangle.cpp:7–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5using namespace std;
6
7int main()
8{
9 cout << "\t\tC++ program to Calculate Area of Right angle Triangle.\n ";
10 float a, b, Area;
11 cout << "Please enter the value for the first cathet of Triangle: ";
12 cin >> a;
13 cout << "Please enter the value for the second cathet of Triangle: ";
14 cin >> b;
15
16 if (a > 0 && b > 0) {
17 Area = b * a * 0.5;
18 cout << "The Area of this Triangle is " << Area << ";" << endl;
19 }
20 else {
21 cout << "The sides of Triangle cannot be negative numbers ! " << endl;
22 }
23
24 system("pause");
25 return 0;
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected