Anda di halaman 1dari 1

#include<iostream.

h>
#include<conio.h>
#include<math.h>
float df(float x,float y)
{
return(x+y);
}
void main()
{
clrscr();
float x0,y0,h,x,x1,y1;
cout<<"enter the value of x0,y0,h,x"<<endl;
cin>>x0>>y0>>h>>x;
x1=x0;
y1=y0;
while(1)
{
if(x1>=x)
break;
y1=y1+h*df(x1,y1);
x1=x1+h;
cout<<"when x="<<x1<<"y="<<y1<<endl;
}
getch();
}

Anda mungkin juga menyukai