I noticed your name and am guessing you are a new programmer. the ! means NOT in C++ so !true means not true while !false means not false.
A while statement is testing for the condition of true. To test for the condition of false, you use the !
1 2 3 4 5 6 7 8
|
while(x<10)
{
// Code
}
while(!(x < 10))
{
// Code
}
|
Here is a simple example. The first while statement tests to see if x is less then 10 and runs. The second will test to see if x is less then 10 and then see if it is not true.
Here, this while statement will run as long as x is NOT EQUAL to 10.
Hopefully that helps you understand how ! is used in C++, Moschops was thinking the same thing I was, WHAT doesn't equal -1? you have nothing else in there and that is a problem. Reading your code, I figured out your code is suppsoe to say
|
while(accountNumber != -1)
|
But before I let you go, you need to know you will have a second problem. The code will compile but you will never be able to leave the loop once you enter it because accountNumber can only be changed before entering the while loop, not while in it. you should place the input in the while statement also.