Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main(){
- int a;
- int b;
- int c;
- int result1;
- int result2;
- cout << "Enter value a: ";
- cin >> a;
- cout << "Enter value b: ";
- cin >> b;
- cout << "Enter value c: ";
- cin >> c;
- result1 = ((-b)+sqrt(pow(b,2)-4*a*c))/2*a;
- result2 = ((-b)-sqrt(pow(b,2)-4*a*c))/2*a;
- system("clear");
- cout << "The roots are "<< result1 <<" and " << result2 << endl;
- return 0;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement