#password checker using iostream

3 messages · Page 1 of 1 (latest)

vocal thistle
#

so to change password from numbers change int password to string password
code::::
#include <iostream>
using namespace std;

int password;

int main() {

cout << "enter ur name ";
cin >> password;

if (password != 123) {
    cout << "wrong password!";

} else {
    cout << "welcome in this secret base ";
}
return 0;

}

snow igloo
#

// heres a version for you if you want it to repeat when you fail, take it if you want you dont need to remove this

#include <iostream>

int password;

int main()
{
std::cout << "enter ur password\n";
std::cin >> password;

   while (password != 1234) {

    std::cout << "wrong password, try again:\n";
    std::cin >> password;

}

    std::cout << "welcome to this secret base\n";

}