Given a char variable c that has already been declared , write some code that repeatedly reads a value from standard input into c until at last a ‘Y’ or ‘y’ or ‘N’ or ‘n’ has been entered.

LANGUAGE: C++

CHALLENGE:

Given a char variable c that has already been declared , write some code that repeatedly reads a value from standard input into c until at last a ‘Y’ or ‘y’ or ‘N’ or ‘n’ has been entered.

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

1 Comment

  1. Hannah Montana on March 18, 2017 at 11:37 pm

    while ( s!=”Y” && s!=”y” && s!=”n” && s!=”N”)
    {
    cin >> s;
    }

    Your welcome.

Leave a Comment

You must be logged in to post a comment.