Skip to main content

Regula-falsi method

#include<iostream.h>
#include<conio.h>
Class regula
{
float x0,x1,step;
Public:
Void input ( );
Voidcalculate ( );
};
float f(float x)
{
 return x*x*x+x*x+9;
 };
 Void regula:: input ( )
 {
 Cout<<"enter the value:";
 Cin>>x0,x1,step;
 }
 Void regula:: calculate ( )
 {
 float  x2;
 for(into i=0;i>=step;i++;)
 {
 x2=x0*f(x1)-x1*f(x0)/f(x1)-f(x0);
 }
 Cout<<"value of roots"<<x2;
 if(x2<0)
 x1=x2;
 else x0=x2
 }
 Void main( )
 {
 Clrscr ( );
 regula r;
 r.input( );
 r.calculate( );
 getch( );
 };

Popular posts from this blog

PHYSICS B.sc SEMESTER lll EXAMINATION, 2018

MATHEMATICS, B.sc. SEMESTER V EXAMINATION,2018

Subject- MATHEMATICS (BMA-E503), Linear Algebra

PHYSICS, B.sc. SEMESTER V EXAMINATION,2018

  Subject:- PHYSICS (BPH-E501), Digital and Analog Circuits and Instrumentation