Answer to Question #282015 in C++ for ali

Question #282015

. Using a do-while loop, write a C++ program to check that the user has typed a letter. The program must not stop until the user types a lowercase or uppercase letter.


1
Expert's answer
2021-12-22T14:18:39-0500
#include <iostream>


int main()
{
    char ch= '\0';
    do
    {
        std::cout << "Please enter a letter\n";
        std::cin >> ch;
    } while (!std::isalpha(ch));
    


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog