write a program to find a side of a right angled triangle whose two side and an angle is given
Answers
If the given side is an even number, then find (N^2)/4. The integer before and after this value will make a right angled triangle. Example, if 8 is the given side, then (8^2)/4 = 16. So the other two sides of the right angled triangle will be 15 and (edit)17.
[Thank you Saddam for correcting me]
Now if the given side is an odd number, then find (N^2)/2. Here also, the integers before and after the found out value will make the right angled triangle. For example, if 3 is the number. Then (3^2)/2 = 4.5 So the other two sides will be 4 and 5.
HOPE IT HELPS YOU
MARK ME AS BAINLIEST
// C++ implementation of the approach
#include<bits/stdc++.h>
#include <iostream>
#include <iomanip>
using namespace std;
// Function to return the hypotenuse of the
// right angled triangle
double findHypotenuse(double side1, double side2)
{
double h = sqrt((side1 * side1) + (side2 * side2));
return h;
}
// Driver code
int main()
{
int side1 = 3, side2 = 4;
cout << fixed << showpoint;
cout << setprecision(2);
cout << findHypotenuse(side1, side2);
}