+ 2
Help me please. Something is wrong here)
#include<stdio.h> #include<conio.h> #include<math.h> int main() { double a = 0.1, b = 1.0, h = 0.1, x, S(0), Y; int k, n; printf("vvedite n"); scanf_s("%d", &n); printf("\t S(x)\t | \tY(x)\t|\tY(x)-S(x)\t|\n"); for (x = a;x <= b;) { k = 0; while(k<=n) { S += cos(k*x) / k; k++; } Y = exp(cos(x))*cos(sin(x)); printf("\t%.3f\t|\t%.3f\t|\t%.3f\t\t|\n", S, Y, S - Y); x += h; } _getch(); }
1 Réponse