Hello, and I think this is a very basic question, but I don't know how to take the negative of a number as inputted by the user. I am trying to make a program to do the quadratic formula, in which the user enters a number (b) and the program inverts it to get -b which is then used in the equation. Is it as simple as putting:
...or do I need to do something more complicated?Code:topline1 = -b + (sqrt(discriminant));
Thanks!