//The body of the loop will be executed at least once before the condition is checked
#include<iostream>
#include<string>
using namespace std;
int main()
{
string password;
do
{
cout << "Enter your password: ";
cin >> password;
}
while (password != "foobar"); //notice semicolon
cout << "welcome, you enterted right password";
}
#include<iostream>
#include<string>
using namespace std;
int main()
{
string password;
do
{
cout << "Enter your password: ";
cin >> password;
}
while (password != "foobar"); //notice semicolon
cout << "welcome, you enterted right password";
}
No comments:
Post a Comment