View Code of Problem 42

#include<stdio.h>
#include<math.h>
int main(){
float a,b,c,x1,x2;
  scanf("%f%f%f",&a,&b,&c);
  x1=(-b+sqrt(b*b-4*a*c))/(2.0*a);
    x2=(-b-sqrt(b*b-4*a*c))/(2.0*a);
    printf(“%.2f %.2f”,x1,x2);
    return 0;
}
/*
Main.c: In function 'main':
Main.c:8:5: error: stray '\342' in program
     printf(“%.2f %.2f”,x1,x2);
     ^
Main.c:8:5: error: stray '\200' in program
Main.c:8:5: error: stray '\234' in program
Main.c:8:15: error: expected expression before '%' token
     printf(“%.2f %.2f”,x1,x2);
               ^
Main.c:8:15: error: stray '\342' in program
Main.c:8:15: error: stray '\200' in program
Main.c:8:15: error: stray '\235' in program
Main.c:4:16: warning: variable 'x2' set but not used [-Wunused-but-set-variable]
 float a,b,c,x1,x2;
                ^
Main.c:4:13: warning: variable 'x1' set but not used [-Wunused-but-set-variable]
 float a,b,c,x1,x2;
             ^
*/

Double click to view unformatted code.


Back to problem 42