write c program find roots using dx=0.7 x^2-25=y?

J* 323-271-0336

New member
dx= increments of 0.7 until y*y<0 because then we have our root



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

double eqn();
double print_ans();
double root_finder(double x, double dx);
double input_data();

void main()
{
double x, dx, xinitial, xfinal;
input_data();
x=xinitial;
xfinal=10;
root_finder(x,dx);

}

double input_data()
{
double x,dx,xinitial,xfinal;
printf("Enter values for xinitial, xfinal, dx\n");
scanf("%lf %lf %lf", xinitial, xfinal, dx);
x=xinitial;
return(xinitial, xfinal, dx);
}
double root_finder(double x, double dx)
{
x=0;
dx=0.7;

//decision on y*y
do
{
if(eqn()>0)
{
x=x+dx;
}
}
}

double eqn()
{
double x, y;
y=x*x-25;
return(y);
}
double print_ans()
{
printf("The roots of the equation are %lf and %lf"





thats what i have so far...
 
Back
Top