quadratic - root = b * b - 4.0f * a * c; { x = sqrt(root);...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> #include <complex> using namespace std; int main() { float a, b, c, x, x1, x2, root; cout<<"enter 3 numbers"<<endl; cin>>a>>b>>c; cout<<"quadractic equation is "<<a<<"x^2 + "<<b<<"x + "<<c<<" = 0"<<endl;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: root = b * b - 4.0f * a * c; { x = sqrt(root); x1 = (-1 * b + x) / (2 * a); x2 = (-1 * b - x) / (2 * a); cout << "Real roots are " << x1 << " and " << x2 << endl; } return 0; }...
View Full Document

This note was uploaded on 07/27/2011 for the course COL 201 taught by Professor Magtibay during the Winter '10 term at De La Salle Lipa.

Ask a homework question - tutors are online