Ver Mensaje Individual
  #4 (permalink)  
Antiguo 14/10/2003, 14:01
Avatar de dn-z
dn-z
 
Fecha de Ingreso: febrero-2003
Ubicación: chile
Mensajes: 185
Antigüedad: 22 años
Puntos: 0
bueno ya lo chequee y es haci !!! cualquier cambio aviso..........

como esta este codigo ( respecto a mi problema)

.................................................. .................................................. .....

#include


int flag;
float res;


float funcion(float valor)
{
return(0.01*((pow(valor,3))-7));
}


void Regula_Falsi(float a, float b , float Tol,int N)
{
float q, q0, q1, p;
int i;
i = 2;
q0 = funcion(a);
q1 = funcion(b);
While (i <= N)
{
p = b - q1 * (b - a) / (q1 - q0);
If (fabs(p - b) < Tol)
{
Flag =1;
res = p;

}
i = i+1;
q = funcion(p);
If (q * q1 < 0)
{
a = b;
q0 = q1;
}
b = p;
q1 = q;
Flag = 0;
}
}

void main(void)
{
Regula_Falsi(0 , 2 , 0.0005 ,10);
printf("Funciono: %i , Salida: %f-5.5",Flag,res);

};

.................................................. .................................................. .....

__________________
ECHALE PIMIENTA!!!