Please help me about C++ program For example This program about insert number :
ID: 3577165 • Letter: P
Question
Please help me about C++ program For example This program about insert number : 1 2 3 4 5 when I input number 10 is show 1 2 3 4 5 10 when i input A is show the number incorrect my program when i input number 200A , it is show 200 but it had to show "Incorrect number , enter number again : " Please tell me how to deal with maybe use cin.clear() cin.get or
this my teacher' example
l
Explanation / Answer
Hi,
if you are using variable to get the input using cin function then try with data type as character type or array type.
you can get the input what ever you want. Thanks!
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.