21 do while
#include <iostream>
#include <string>
int main()
{
std::string password = "123";
std::string guess;
do // guess at least one time
{
std::cout << "Guess the password: ";
std::cin >> guess;
} while (guess != password);
return 0;
}
#include <iostream>
#include <string>
int main()
{
std::string password = "123";
std::string guess;
do
{
std::cout << "Guess the password: ";
std::cin >> guess;
} while (false); // do once
return 0;
}