Search
 
SCRIPT & CODE EXAMPLE
 

CPP

C++ Area of Scalene Triangle

    float a, b, c, d, e;
    
    cout << "Finding the Area of Scalene Triangle using Heron's Formula
";
    cout << "1st Side of a Triangle: ";
    cin >> a;  
    cout << "2nd Side of a Triangle: ";
    cin >> b;
    cout << "Angle Between Sides: ";
    cin >> c;

    e = 0.5 *  (a + b + c); 	//(a + b + c) / 2
    d = sqrt(e*(e-a)*(e-b)*(e-c));

    cout << "The area is: " << d << endl;
Comment

PREVIOUS NEXT
Code Example
Cpp :: ue4 get socket location c++ 
Cpp :: how to create a pair of double quotes in c++ 
Cpp :: get ascii value of qchar 
Cpp :: c++ index of nth occurence 
Cpp :: sfml mouse click 
Cpp :: cannot open include file unreal 
Cpp :: time measurement c++ 
Cpp :: draw rect outline sdl2 
Cpp :: fast input and output c++ 
Cpp :: assign a struct to another c++ 
Cpp :: c++ default array value not null 
Cpp :: differency between c++ std and stl 
Cpp :: max element in vector c++ 
Cpp :: qt float to qstring 
Cpp :: vector of structs c++ 
Cpp :: print vector 
Cpp :: go through std vector 
Cpp :: how to clear screen in C++ console 
Cpp :: string to int arduino 
Cpp :: string count occurrences c++ 
Cpp :: time delay in c++ 
Cpp :: sort function from bigest to smallest c++ 
Cpp :: std distance c++ 
Cpp :: factorial using recursion cpp 
Cpp :: gfgdf 
Cpp :: array and for loop in c++ 
Cpp :: how to put bitset into a string in c++ 
Cpp :: how print fload wiht 3 decimal in c++ 
Cpp :: c++ call method in same class 
Cpp :: less than operator overloading in c++ 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =