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

Function main

Lab_01/11_rectangle.cpp:8–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected