How do I print the values of sin, cos, and tan from 0 degree to 360 degrees in the C++ programming language?
#include <iostream>
#include <math.h>
using namespace std;
#define PI 3.14159265
int main()
{
for (int i = 0; i < 360; i++) {
cout << i << " degrees:" << endl;
cout << "Sin => " << sin(PI*i/180) << endl;
cout << "Cos => " << cos(PI*i/180) << endl;
cout << "Tan => " << tan(PI*i/180) << endl;
}
}
I have tried above the above code but it gives only the values from 311 degree to 360 degree. How can I print the values of sin, cos, and tan of degree 0 to degree 360 in the console?