Horje
C++ Area of Triangle Code Example
C++ Area of Triangle
    //uisng Heron's Formula
    float first, second, third, semiperimeter, area;

    cout << "Input the first side of the triangle: ";
    cin >> first;
    cout << "Input the first side of the triangle: ";
    cin >> second;
    cout << "Input the third side of the triangle: ";
    cin >> third;

    semiperimeter = (first + second + third)/2;
    area = sqrt (semiperimeter*(semiperimeter-first)*(semiperimeter-second)*(semiperimeter-third));

    cout << "The area of the triangle is " << area << endl;




Cpp

Related
matrix layout in C++ Code Example matrix layout in C++ Code Example
Plus (programming language) Code Example Plus (programming language) Code Example
g++ -wall option meaning Code Example g++ -wall option meaning Code Example
c++ visual studio 19 how to make colord button from code Code Example c++ visual studio 19 how to make colord button from code Code Example
C++ area & circumference of a circle Code Example C++ area & circumference of a circle Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9