#include <stdio.h>
#include <math.h>
float radian(int degrees);
void main() {
int x[] = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360};
float data[3][13] = {{}, {}, {}};
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 13; j++) {
if (i == 0)
data[i][j] = sin(radian(x[j]));
else if (i == 1)
data[i][j] = cos(radian(x[j]));
else if (i == 2)
data[i][j] = tan(radian(x[j]));
}
}
for (int i = 0; i < 13; i++)
printf("x = %d | sin(x) = %.2f | cos(x) = %.2f | tan(x) = %.2f\n", x[i], data[0][i], data[1][i], data[2][i]);
}
float radian(int degrees) {
return degrees / 180.0 * 3.14159;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: