Wednesday, 23 April 2014

Program to find the solution of the equation using Euler's Method

#include<stdio.h>
#include<conio.h>
#include<math.h>

int main()
{
float x1,y1,x2,y2,xf,h,s;
//clrscr();
printf("enter the initial points :\n");
scanf("%f%f",&x1,&y1);
printf("enter the final points :\n");
scanf("%f",&xf);
printf("enter the step size :\n");
scanf("%f",&h);
printf("X\t\tY\n");

while(x1<=xf)
{
  printf("%.2f\t\t%.2f\n",x1,y1);
  s=x1*y1;
  y2=y1+h*s;
  x2=x1+h;
  x1=x2;
  y1=y2;
}

getch();
}

No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2016