Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am writing a c++ program to validate input of a 3 digit number in any order. F

ID: 3654998 • Letter: I

Question

I am writing a c++ program to validate input of a 3 digit number in any order. For example 321 can be represented as

312

132

123

213

231

The program should check for all these combinations and give out a statement i.e "you have matched all the digits". I know how to validate the first and the last digit but i'm not sure how to validate the middle one. I want to do this without using arrays.

To check for the last digit you would use

if (guess==actualvalue){

cout<<"The last digits are the same "<<endl;

}

However, I am not sure on how to validate the digit in the middle without using arrays. How would you do this?

Explanation / Answer

count=0; number;// It store your input number r1=number%10; number=number/10; r2=number%10; r3=number/10 if (r1==1|r1==2|r1==3){ count++; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote