You have there the condition
if(password > 6) which means you must type number 7 or greater to pass the condition because of char ">" which means "greater" (not greater or equal) ;)
If you enter a character into an integer via std::cin the outcome becomes unpredictable.
Make your password a std::string and try using that, look into c-strings, or add a cin fail check loop to see if cin had trouble with the last input.
1 2 3 4 5 6 7 8
while (!std::cin) // cin has a badbit flag set.
{
std::cin.clear(); // reset flags
std::cin.ignore(0x7FFFFFFF, '\n'); // clear the buffer (you should use std::numeric_limits<std::streamsize>::max() for this. I'm cheating with a max int in hexadecimal.)
std::cin.sync(); // sync buffer
std::cout << "ERROR: Invalid Input. Please Retry.\n >";
std::cin >> userInput;
}