Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main(){
- double a,b,c,x1,x2,d;
- scanf("%lf %lf %lf",&a,&b,&c,&d);
- d = pow(b,2) - (4 * a * c );
- if((a==0) || d<0){
- printf("Impossivel calcular\n");
- }
- else{
- x1 = (-b + sqrt(d) ) / (2 * a);
- x2 = (-b - sqrt(d) ) / (2 * a);
- printf("R1 = %.5lf\n",x1);
- printf("R2 = %.5lf\n",x2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement