/* Runge-kutta method of 4th order to solve 10*dy/dx=(x*x)+(y*y)*/ # include <stdio.h> # include <conio.h> void main() { int c=0; float x,y0,xp,h,i,y1,m1,m2,m3,m4; float f(float,float); clrscr(); printf("Solution by Runge kutta 2nd order Method\n"); printf("Enter initial Boundry condition x,y : "); scanf("%f%f",&x,&y0); printf("Enter Value of X at which Y is required : "); scanf("%f",&xp); printf("Enter Interval ,h : "); scanf("%f",&h); printf(" No. X\t m1 \t m2\t m3 \t m4 \t Y\n"); printf("-------------------------------------------------------------------\n"); for(i=x;i<=xp;i=i+h) { c++; m1=h*f(i,y0); m2=h*f(i+(h/2),y0+(m1/2)); m3=h*f(i+(h/2),y0+(m2/2)); m4=h*f(i+h,y0+m3); y1=y0+((m1+2*m2+2*m3+m4)/6); printf("%2d %5.6f %5.6f %5.6f %5.6f %5.6f %5.6f\n",c,i,m1,m2,m3,m4,y1); y0=y1; } getch(); } ...