#include <stdio.h> #include <stdlib.h> #include<math.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { float a,b,c; scanf("%f %f %f",&a,&b,&c); printf("%0.2f ",(-b+sqrt(b*b-4*a*c))/2*a); printf("%0.2f",(-b-sqrt(b*b-4*a*c))/2*a); } |
Double click to view unformatted code.