Last active
February 20, 2019 13:52
-
-
Save LeonardoPizzoquero/801b29c22c48c617e6a4e2aa3123592d to your computer and use it in GitHub Desktop.
HonestTightAggregators created by LeonardoPizzoqu - https://repl.it/@LeonardoPizzoqu/HonestTightAggregators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
int main(void) { | |
float a,b,c,delta; | |
printf("Digite o valor de a: \n"); | |
scanf("%f", &a); | |
printf("Digite o valor de b: \n"); | |
scanf("%f", &b); | |
printf("Digite o valor de c: \n"); | |
scanf("%f", &c); | |
delta = (pow(b, 2)) - 4 * a * c; | |
if(delta > 0){ | |
printf("X1 = %.2f\n", (-b + sqrt(delta)) / (2 * a)); | |
printf("X2 = %.2f\n", (-b - sqrt(delta)) / (2 * a)); | |
} else if(delta == 0){ | |
printf("Única raiz = %.2f\n", (-b + sqrt(delta)) / (2 * a)); | |
} else { | |
printf("Não há raízes reais"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment