QUADRATIC FORMULA CODES

Jul 30, 2012 at 4:35am
hello, am new in c++, i have tried to code the quadratic formula but surferring from several error. please can some one put me true?
Jul 30, 2012 at 4:40am
Could you please show us what you have done so far...

There's not really much to it as long as you know basic operators in C++ and input/output stream

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include<iostream>
#include<cmath>

using namespace std; 

int main()
{
    // Declare variables
    // Ask user to input values for a, b, and c
    // Read these variables
    // Do something with them
    // Output the two solution
    return 0;
}
Last edited on Jul 30, 2012 at 4:48am
Jul 30, 2012 at 4:57am
dear, the major problem is how to code for the square root. But i can still show you the code if you prefare that. thanks.
Jul 30, 2012 at 4:59am
Yes, please put the code so I can know what the problem is.

Anyway, for square root: double bla = pow((double) blabla, 0.5);.
Last edited on Jul 30, 2012 at 5:02am
Jul 30, 2012 at 5:06am
ok brother. but please bear with me coz my battery is almost down, and am from nigeria (no sufficint light), so i'll do so wen charged. Thankz man.
Jul 30, 2012 at 5:28am
here is some help for you read it out...
http://www.cplusplus.com/forum/beginner/9735/
Jul 30, 2012 at 4:38pm
Thank you. I now understand.
Topic archived. No new replies allowed.