I wrote the code for the task, but it is not executed as it should be, add or suggest what should be written so that it work | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

I wrote the code for the task, but it is not executed as it should be, add or suggest what should be written so that it work

Here is the condition of the problem 10 Calculate the product of the minimum and maximum values ​​of the function. Number of argument values ​​n=19. The y argument changes from an initial value of 0.1 in steps of 0.75 (radians): g = 1+c/(b-y)sin³(y) c = 3452 b = 1673 #include <stdio.h> #include <math.h> [[double funcg(double,double, double);]] int main() { int i, n, nmax; double b,c,y,ystep; double xmin, xmax; double g; double x; n=1; nmax=19; b=1.673; c=3.452; y=0.1; ystep=0.75; xmin=xmax=funcg(b,c,y); printf("Результат\n"); for (i = n; i <= nmax; i++) { y=y+ystep; g=funcg(b,c,y); if (xmin>g) xmin=g; if (xmax<g) xmax=g; printf("Аргумент %4.3f, Min %4.3f, Max %4.3f \n", y, xmin, xmax); } x=xmin*xmax; printf("xMin= %4.3f, xMax= %4.3f \n", xmin, xmax); printf("Результат = %4.3f \n", x); return 0; } [[double funcg(double b, double c, double y) ]] { [[double g;]] g=(1+c/((b-y)*pow(sin(y),3))); return g; }

11th Dec 2022, 9:33 PM
Marjan Borodaki
1 ответ
0
How to add code without (double) so it does the same thing. I've enclosed them with double square brackets [[ ]]
11th Dec 2022, 9:34 PM
Marjan Borodaki