vendredi 3 novembre 2017

Assigning var to var in C

p=(-b-sqrt(b*b-4*a*c))/(2*a);
q=(-b+sqrt(b*b-4*a*c))/(2*a);

if(p<q){
p=x1;
q=x2;
}

else{
p=x2;
q=x1;

}

I want to assign these values if the conditions are true, however, I get only 0 values from x1 and x2.

Can you point out where I'm wrong?

Aucun commentaire:

Enregistrer un commentaire