-1
Exercise: Write an algorithm to generate and write a table with s sine values of an angle A in radians, using the series of Truncated Mac-Laurin, presented below:
A3
A5
A7
sen A = A - 6 + 120 - 5040Conditions: the values of angles A shall vary from 0.0 to 6.3 inclusive from 0.1 in 0.1.
my code :
#include <stdio.h>
#include <math.h>
int main () {
float A = 0.0, valor_seno;
float aprs_tela;
while (A <= 6.3) {
aprs_tela = A;
A = A - (((pow(A,3) / 6) + (pow(A,5) / 120)) - (pow(A,7) / 5040));
valor_seno = sin(A);
printf("O valor do seno (%.1f) com a série de Mac-Laurin é %.2f\n\n",aprs_tela ,valor_seno);
A = A + 0.1;
}
return 0;
}
Behold here how to format posts. There are also keyboard shortcuts, and the formatting bar in the "no mobile" version of the site, with much of the possible commands.
– Bacco