View Code of Problem 42

# include<stdio.h>
# include<math.h>
int mian(void)
{
    float a,b,c,x1,x2;
    scanf("%f%f%f",&a,&b,&c);
    x1 = (-b+sqrt(b*b-4*a*c))/(2*a);
    x2 = (-b-sqrt(b*b-4*a*c))/(2*a);
    printf("%.2f\n",x1,x2);
    return 0;
}
/*
Main.c: In function 'mian':
Main.c:9:5: warning: too many arguments for format [-Wformat-extra-args]
     printf("%.2f\n",x1,x2);
     ^
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
*/

Double click to view unformatted code.


Back to problem 42