Question: Need a program that outputs all possible combinations of X amount of numbers depending on the length of the password. For example it will ask
Need a program that outputs all possible combinations of X amount of numbers depending on the length of the password. For example it will ask the user the length of the password and if they input 3 then it will display all possible combinations from numbers 0 through 9 so the sample output will look like.
000, 001, 002, 003, 004, 005, 006,
.....................................................
994, 995, 996, 997, 998, 999
after it will ask the user if they want to search for a number. It will ask the user what numbers they want to search through and will display them for example.
How many numbers do you want to input? 2.
Enter the numbers you would like to display that start with those 2 numbers? 56. Then it will display all possible numbers starting with 56.
output example
5600, 5601, 5602, ..........., 5697, 5698, 5699
if the user chooses 1 number to input starting with the number 5 then output would be like:
5001, 5002, 5003, ..........., 5999
and depending on the length of the password it will display more numbers the max they could enter is 9 for the length. The max for searching a number should be equal to the length or less than the length and greater than zero.
need the code to be written in C++.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
