Hello, this is my first topic here. I start lesson c++ with a book, and i find this exercie:
Write from keyboard a program who read a real numer x, and show on monitor the result of: Here:http://i.imgur.com/TkIk1le.png
I don't see that the variable 'a' is assigned a value before the code tries to compare it to 10 in the if statements. But if I'm reading the exercise correctly, it looks like it should be looking at the value of x.
I think also that there are vertical lines in the formula in the image around the value under the square root, meaning the absolute value should be used. Otherwise the code may be trying to take the square root of a negative number, which could result in the NAN (not a number) response.