Could you tell me what is wrong?
#include <stdio.h> #include <math.h> double a,b,c; double d= b * b - 4 * a * c; int main() { printf("Enter a, b and c: "); scanf("%lf %lf %lf", &a, &b, &c); if (a == 0) { double x; x = -c/b; printf("x= %2f\n",x); } else if(d>0) { double x1; x1 -= -b + sqrt(d) / (2 * a); double x2; x2 = -b - sqrt(d) / (2 * a); printf("x1=%lf\nx2=%lf", x1, x2); } else printf("It won't work"); return 0; } At the moment it doesn't even compile. The output is: /usr/bin/cmake --build /mnt/c/Users/radbi/CLionProjects/untitled4/cmake-build-debug --target untitled4 -- -j 4 [ 50%] Building C object CMakeFiles/untitled4.dir/main.c.o /mnt/c/Users/radbi/CLionProjects/untitled4/main.c:5:15: error: initializer element is not constant double d= b * b - 4 * a * c; ^ CMakeFiles/untitled4.dir/build.make:62: recipe for target 'CMakeFiles/untitled4.dir/main.c.o' failed make[3]: *** [CMakeFiles/untitled4.dir/main.c.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/untitled4.dir/all' failed make[2]: *** [CMakeFiles/untitled4.dir/all] Error 2 CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/untitled4.dir/rule' failed make[1]: *** [CMakeFiles/untitled4.dir/rule] Error 2 Makefile:118: recipe for target 'untitled4' failed make: *** [untitled4] Error 2