Given a string variable s that has already been declared, write some code that repeatedly reads a value from standard input into s until at last a "Y" or "y"or "N" or "n" has been entered.
.
.
Click on the title for the solution
.
.
while ( s!="Y" && s!="y" && s!="n" && s!="N")
{
cin >> s;
}
.
Click on the title for the solution
.
.
This is the answer:
:
while ( s!="Y" && s!="y" && s!="n" && s!="N")
{
cin >> s;
}
Comments
Post a Comment