Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

/* C program for euler method*/

#include<stdio.h>

#include<conio.h>

main()

printf("OUTPUT:");

float x,y,yn,h,d,i;

printf("\t\nEnter the value of h:");

scanf("%f",&h);

printf("\t\nEnter the value of x:");

scanf("%f",&x);

printf("\t\nEnter the value of y:");

scanf("%f",&y);

for(i=0;i<10;i++)

d=x+y;

printf("\t\tnd=%f",d);

yn=y+(h*d);

printf("\t\tyn=%f",yn);

x=x+h;

y=yn;

getch();

}
OUTPUT:

Enter the value of h:5

Enter the value of x:6

Enter the value of y:12

nd=18.000000 yn=102.000000 nd=113.000000

yn=667.000000 nd=683.000000 yn=4082.000000

nd=4103.000000 yn=24597.000000 nd=24623.000000 yn=14771

2.000000 nd=147743.000000 yn=886427.000000

nd=886463.000000 yn=5318742.000000 nd=53187

83.000000 yn=31912658.000000 nd=31912704.000000

yn=191476176.000000 nd=191476224.000000 yn=11488

57344.000000

You might also like