hi there,(adsbygoogle = window.adsbygoogle || []).push({});

i have written a small program in C++ and if the user puts in the wrong values for some of the variables the operation will end up trying to square root a negative number and this returns that the answer is not a number

can anyone show me how to write an if function that iforCode (Text):double answerplusare not numbers it will display an error messageCode (Text):double answerminus

thanks

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# C++ nan help

**Physics Forums | Science Articles, Homework Help, Discussion**