#include <stdio.h>
#include <math.h>
int main(void) {
float x,y,a=-1, b=4, n=1000, h;
float max, min, S;
h=(b-a)/n;
x=a;
S
=min
=max
=pow(x
,3)-12*x
+7;while(x<b){
x=x+h;
if(max<y) max=y;
if(min>y) min=y;
S=S+y;
}
printf("min=%f , max=%f \n "x
, y
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgppbnQgbWFpbih2b2lkKSB7CmZsb2F0IHgseSxhPS0xLCBiPTQsIG49MTAwMCwgaDsKZmxvYXQgbWF4LCBtaW4sIFM7CnByaW50Zigi0JLQstC10LTRltGC0YwgeCBcbiIpOwpzY2FuZigieD0lZiAiLCAmeCApOwpwcmludGYoItCS0LLQtdC00ZbRgtGMIHkgXG4iKTsKc2NhbmYoInk9JWYgIiwgJnkpOwpoPShiLWEpL247Cng9YTsKUz1taW49bWF4PXBvdyh4LDMpLTEyKngrNzsKd2hpbGUoeDxiKXsKCXg9eCtoOwoJeT1wb3coYSwzKS0xMiphKzc7CglpZihtYXg8eSkgbWF4PXk7CglpZihtaW4+eSkgbWluPXk7CglTPVMreTsKfQpwcmludGYoIm1pbj0lZiAsIG1heD0lZiBcbiAieCwgeSk7CglyZXR1cm4gMDsKfQo=
prog.c: In function ‘main’:
prog.c:21:29: error: expected ‘)’ before ‘x’
printf("min=%f , max=%f \n "x, y);
^
prog.c:21:14: warning: format ‘%f’ expects a matching ‘double’ argument [-Wformat=]
printf("min=%f , max=%f \n "x, y);
^
prog.c:21:23: warning: format ‘%f’ expects a matching ‘double’ argument [-Wformat=]
printf("min=%f , max=%f \n "x, y);
^