#include #include //This will solve quadratic equations. Whoop dee doo. float A; float B; float C; int main(void) { printf("This program will solve a given quadratic equation and \noutput the answer.\n"); printf("AX^2 + BX + C = 0\n"); printf("Input A: \n"); scanf("%f", &A); printf("Input B: \n"); scanf("%f", &B); printf("Input C: \n"); scanf("%f", &C); if ((pow(B,2) - (4*A*C)) < 0) { printf("The answer is:\n"); printf("%f + %fi\nand\n%f - %fi", (-B)/(2*A), sqrt(-1*(pow(B,2)- (4*A*C)))/(2*A), (-B)/(2*A), sqrt(-1*(pow(B,2)- (4*A*C)))/(2*A)); return 0; } else { printf("The answer is:\n"); printf("%f + %f\nand\n%f - %f", (-B)/(2*A), sqrt(pow(B,2)-(4*A*C))/(2*A), (-B)/(2*A), sqrt(pow(B,2)- (4*A*C))/(2*A)); return 0; } }