Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
/**Bismillahir Rahmanir Rahim.**/
#include <stdio.h>
int main()
{
double A,B,C,d,e,f,g;
scanf ("%lf%lf%lf", &A,&B,&C);
d=B*B-4*A*C;
e=pow(d,.5);
if(d<0||A==0)
printf ("Impossivel calcular\n");
else
{
f=(-B+e)/(2*A);
g=(-B-e)/(2*A);
printf ("R1 = %.5lf\n",f);
printf ("R2 = %.5lf\n",g);
}
return 0;
}
math.h
ReplyDeletewhy use .5 for divide with d??
ReplyDeleteeu tambem nao entendi
Deletewhy you take 3 double data type but in question they said float type of data
ReplyDeletebecause u need to put atleast 5 float numbers after point ..so u need to use double instead of float numbers..
ReplyDelete