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?