#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float treeHeight, shadowLength, angleElevation;
cout << "Enter the length of shadow: ";
cin >> shadowLength;
cout << "Enter the angle of elevation in radians: ";
cin >> angleElevation;
treeHeight = shadowLength * tan(angleElevation);
cout << "Height of tree = " << treeHeight;
return 0;
}
Comments
Leave a comment