Quote
bool renew = ((userpassword != password1) || (userpassword != password2)|| (userpassword != password3));
This condition will always be
true
, since the three
passwordN
variables are different. If
userpassword
is equal to any one of them, it will not be equal to the others. You should be using
&&
instead of
||
here.
Logical OR operator: || | Microsoft Docs[
^]
Logical AND Operator: && | Microsoft Docs[
^]
Also, as others have pointed out, you never update the value of the
renew
variable inside the loop. You initialize it once, outside of the loop, before the
userpassword
variable has been initialized. You need to move the test inside the loop.