vikky
public text v1 · immutable#include <stdio.h>#define DELTA 0.01static float test_func(float x){ return x*x;}static float integrate(float (*func)(float),float ll, float ul){ float set, result; result=0; for(set=ul;set>=ll;set-=DELTA){ result+=(*func)(set)*DELTA; } return result;}//static float (*func)(float) = test_func;int main(int argc, char **argv){ float test; test = integrate(test_func,1,4); printf("ans=%f\n",test); return 0;}