View Code of Problem 42

#include<stdio.h>
void main(){
int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  printf("%d %d",-b+sqrt(b*b-4*a*c)\2*a,-b-sqrt(b*b-4*a*c)\2*a);
}
/*
Main.c:2:6: warning: return type of 'main' is not 'int' [-Wmain]
 void main(){
      ^
Main.c: In function 'main':
Main.c:5:3: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
   printf("%d %d",-b+sqrt(b*b-4*a*c)\2*a,-b-sqrt(b*b-4*a*c)\2*a);
   ^
Main.c:5:21: warning: incompatible implicit declaration of built-in function 'sqrt'
   printf("%d %d",-b+sqrt(b*b-4*a*c)\2*a,-b-sqrt(b*b-4*a*c)\2*a);
                     ^
Main.c:5:3: error: stray '\' in program
   printf("%d %d",-b+sqrt(b*b-4*a*c)\2*a,-b-sqrt(b*b-4*a*c)\2*a);
   ^
Main.c:5:37: error: expected ')' before numeric constant
   printf("%d %d",-b+sqrt(b*b-4*a*c)\2*a,-b-sqrt(b*b-4*a*c)\2*a);
                                     ^
Main.c:5:37: error: stray '\' in program
Main.c:5:37: warning: format '%d' expects argument of type 'int', but argument 2 has type 'double' [-Wformat=]
Main.c:5:37: warning: format '%d' expects a matching 'int' argument [-Wformat=]
*/

Double click to view unformatted code.


Back to problem 42