In: Computer Science
Solution:
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double a, b, c;
//Correct spelling of data type double is double not Double
b=2;
//Variable cannot be assigned to constant it should be other way around
cout<<"Enter length of hypotenuse"<<endl;
cin>>c;
//endl has to be removed after c
cout<<"Enter length of a side"<<endl;
//The operator after cout should be << not >>
cin>>a;
double intermediate = pow(c, 2)-pow(a, 2);
b = sqrt(intermediate);
cout<<"Length of other side is:" <<b<<endl;
//endl should be used to end a line not endline,b should be preceded by <<
return 0;
}
Output: