answersLogoWhite

0

C programing of regula falsi method?

User Avatar

Anonymous

14y ago
Updated: 8/18/2019

try this out...

#include

#include

float valcal(float);

int main(){

float a,b,f,x,f1,f2,f3,i;

a=2;

b=3;

int flag=0;

f1=valcal(a);

f2=valcal(b);

printf("\n\n%f %f",f1,f2);

for(i=0;i<6;i++){

if(f1*f2<0){

x=a-((b-a)*f1/(f2-f1));

flag=1;

//printf("\n\nval of x : %f",x);

}

f3=valcal(x);

//printf("\n\nf3: %f",f3);

//(f3<0)?(f1=f3):(f2=f3);

if(f3<0){

f1=f3;

a=x;

}

else{

f2=f3;

b=x;

}

}

if(flag==1)

printf("\n\nTHE SOL IS : %f",x);

else

printf("\nNO SOLUTION\n");

printf("\n\n");

system("pause");

}

float valcal(float x){

float f;

f=((x*x*x)-(2*x)-5);

return f;

}

NEED MORE HELP...

CONTACT ME THROUGH MAIL...

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Is c programing a procedure oriented programing?

yes


Why you need C programming?

C- Programing is basically a programing language of a computer. It helps to create software programing language which is usefull in creating softwares &amp; data base programes. C programing language is the first &amp; basic programing language. Other programing languages are:- C, C++ &amp; C# (latest).


What do you mean by c?

c is a programing language


What is statement in C programing?

One of the statements, obviously.


What are the examples of programing language?

c, c++, java, prolog, fortran, basic, ...


How do you perform programs on c programing language?

Using IDE environment


What are some examples of programming language?

The most well-known programming languages are C, C++, C#, CSS, HTML, Javascript, PHP, Pascal/Delphi, Prolog, Python, Ruby, Visual Basic, and Visual Basic .NET, java.


Is c an object oriented programing language?

C language is not a program, and it isn't an object-oriented language either.


Why c language is called c language?

C is descendent from another programing language called B which was at that time when 'C' was invented. That's why it derived its name as 'C' successive to 'B'.


What are programming language that produced c?

C is a programming language. Example of C or C++ Programing would be the following: add matrices, get ip address, and read files.


List some programing languages?

* Java * C, C++ * Basic * COBOL * Fortran * Pascal * .Net * Visual Basic * etc...


Why study c plus plus programming?

we are using c plus plus programming for developing object oriented programing software.