fork(1) download
  1. #include <stdio.h>
  2. #include<math.h>
  3.  
  4. int main(void) {
  5. float a, b, c, d, rslt1, rslt2;
  6. float sqrt(float d);
  7. scanf("%f %f %f", &a, &b, &c);
  8. d = b * b - 4 * a * c;
  9. if(d < 0) then
  10. ;printf ("korney net");
  11. if(d = 0) then
  12. rslt1 = (-b + sqrt(d) / (2 * a));
  13. rslt2 = (-b + sqrt(d) / (2 * a));
  14. printf("%f %f", rslt1, rslt2);
  15. if(d > 0) then
  16. rslt1 = (-b + sqrt(d) / (2 * a));
  17. rslt2 = (-b - sqrt(d) / (2 * a));
  18. printf("%f %f", rslt1, rslt2);
  19. return 0;
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1.0 -2.0 -3.0
compilation info
prog.c: In function ‘main’:
prog.c:6:7: error: conflicting types for ‘sqrt’
 float sqrt(float d);
       ^~~~
In file included from /usr/include/features.h:364:0,
                 from /usr/include/stdio.h:27,
                 from prog.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:156:1: note: previous declaration of ‘sqrt’ was here
 __MATHCALL (sqrt,, (_Mdouble_ __x));
 ^
prog.c:9:12: error: ‘then’ undeclared (first use in this function)
  if(d < 0) then
            ^~~~
prog.c:9:12: note: each undeclared identifier is reported only once for each function it appears in
prog.c:11:2: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  if(d = 0) then
  ^~
prog.c:12:2: error: expected ‘;’ before ‘rslt1’
  rslt1 = (-b + sqrt(d) / (2 * a));
  ^~~~~
prog.c:16:2: error: expected ‘;’ before ‘rslt1’
  rslt1 = (-b + sqrt(d) / (2 * a));
  ^~~~~
stdout
Standard output is empty