The problem is that cin >> y;
reads one word, whereas there are two words in "Im qwerty"
. In other words, this program always outputs "Your account has been deactivated."
because one word never matches two words.
If you would like to read multiple words, the easiest is to read an entire line, e.g. replace cin >> y;
with getline(cin, y);
.
2
solved C++ If-else statement using strings and comparing strings