Eulers

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Eulers as PDF for free.

More details

  • Words: 117
  • Pages: 2
Er.Puneet kumar tyagi

AIM :- Write a program for EULERS METHOD

#include<stdio.h> #include #include<math.h> float f(float x,float y) { return(x-(y*y)); } void main() { float x0,xg,y0,yg,h; int i,n; clrscr(); printf("\n enter the initial value of x0"); scanf("%f", &x0); printf("\n enter the initial value of y0"); scanf("%f", &y0); printf("\n enter the given value of xg"); scanf("%f", &xg); printf("\n enter the given value of step size h-"); scanf("%f", &h); n=xg-x0/h; for(i=0;i<=n;i++) { yg=y0+h*f(x0,y0); x0=x0+h; y0=yg; } printf("\n the final value of yg=%f",y0); getch(); }

Er.Puneet kumar tyagi

OUTPUT Enter the initial value of x0-0 Enter the initial value of y0-1 Enter the given value of xg-4 Enter the given value of step size h-1 The final value of yg=4.000000

Related Documents

Eulers
June 2020 0