Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by Ryan ( 5 years ago )
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a,b,c,x1,x2;
cout << "a : ";
cin >> a;
cout << "b : ";
cin >> b;
cout << "c : ";
cin >> c;
cout << "persamaan : (" << a << ") x^2 + (" << b << ") x + (" << c << ") = 0\n";
x1 = (-1*b + sqrt(b*b-4*a*c))/2*a;
x2 = (-1*b - sqrt(b*b-4*a*c))/2*a;
cout << "x1 = " << x1 << endl;
cout << "x2 = " << x2 << endl;
return 0;
}
Revise this Paste