Created
February 13, 2015 06:21
-
-
Save MohammedBadr20s/9b571f52576c75791de1 to your computer and use it in GitHub Desktop.
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 <iostream> | |
#include <iomanip> | |
#include <math.h> | |
using namespace std; | |
int main() | |
{ | |
float A , B , C ; | |
double delt , root , R1 , R2; | |
cin >> A >> B >> C; | |
delt = pow(B,2) - 4*A*C; | |
if (root = 0 || delt < 0 ) | |
{ | |
cout << "Impossivel calcular" << endl; | |
} | |
else | |
{ | |
R1 = -B + sqrt(delt)/2*A; | |
R2 = -B - sqrt(delt)/2*A; | |
cout << fixed << setprecision(5) << "R1 = " << R1 << "\nR2 = " << R2 << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment