sin cos tang

I want the user to input a degree of an angle and then use that degree and do the sin cos and tang function but so far no luck


#include<iostream>
#include<cmath>
#include<iomanip>

using namespace std;

int main()

{
const int PI = 3.14;
float degree;

cout << "Please enter the degee of the angle." <<endl;
cin >> degree;
cout << setprecision(4) << fixed <<endl;
cout << sin((PI/180)*degree);

system("pause");

return 0;

}
You're assigning 3.14 to an integer. It should be a double.
As a result, integer division is being performed further down (3/180 is 0) and so you're printing sin(0) every time.
Topic archived. No new replies allowed.