write a c code for df/dx=x^2 solution with a boundary condition f(1)= 2 and h= 0.01
//We are going to use Euler's method of solving differential equation
//Here, y_next = y_prev + h*function(x_prev, y_prev)
//we have f(x) = x^2
#include<stdio.h>
double function(double);
int main() {
int i = 0;
double x_prev, x_next;
double y_next, y_prev, h;
h = 0.01; //step size
x_prev = 1; //initial value of x
y_prev = 2; //boundary value
do {
y_next = y_prev + h * function(x_prev);
x_next = x_prev + h;
printf("x\t\ty\t\th\n");
printf("%4.6lf\t%4.6lf\t%4.6lf\n", x_next, y_next, h);
x_prev = x_next;
y_prev = y_next;
i++;
} while (i<20); //You can also use y_next-y_prev <0.001 like condition
getchar();
return 0;
}
double function(double x) {
return x*x;
}

write a c code for df/dx=x^2 solution with a boundary condition f(1)= 2 and h= 0.01