All pastes #391143 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-03-11 22:30 UTC
rendered paste body
//

#include <iostream>
#include <cmath>

using namespace std;

int main ()
{
	int ch;
    int inta, intb, intc;
	double intdiscriminant, getx, getz;

	cout << "Please enter three integers:";
	cin >> inta >> intb >> intc;

	intdiscriminant = pow(inta, 2.0) - 4*inta*intc;
	cout << "The value of the discriminant: " << intdiscriminant << endl;

		if (int(intdiscriminant) > 0)
			cout << "There are two solutions";
		if (int(intdiscriminant) = 0) 
			cout << "There is only one solutions";
		if (int(intdiscriminant) < 0)
			cout << "There are no solutions";

		getx = (-intb + sqrt(pow(intb, 2.0) - 4*inta*intc))/2*inta;
			cout << getx;

		getz = inta*pow(getx, 2.0) + intb*getx + intc;
			cout << endl << endl << getz;




			//pauses the screen for viewing
         cin >> ch;
    return 0;
}