All pastes #904686 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-02-15 04:10 UTC
rendered paste body
#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
float sqrt(float);

int main()
{
	int a,b,c;
	float total1, total2;
	float sqrt;
	
	
	

	cout <<"Enter first number\n";
	cin >> a;
	cout <<"Enter second number\n";
	cin >> b;
	cout <<"Enter last number\n";
	cin >> c;
	
	if ( b*b-4*a*c >= 0 )
		{
			total1=(-b+sqrt(b*b-4*a*c))/2*a;
			total2=(-b-sqrt(b*b-4*a*c))/2*a;
			cout<<"the total is \n"<<total1;
			cout<<"the total is \n"<<total2;

		}
		else
		{
			cout <<"the program cannot calculate complex roots\n";
		}
	system ("pause");	
	return 0;
}