This is what I have written, but if I type in "E" to exit, it loops to enter in a number again and doesn't exit.
I don't see the loop, but "E" is not a valid float number. If you want the possibility of the user input to be either text or a number, read the input as a string. Then, if the string is not "E", (attempt to) convert the input string into a float.
Reputation Points: 2780
Solved Threads: 312
long time no c
Offline 4,790 posts
since Apr 2004