That's a start, now you go from there and figure out how to construct each possible combination (hint: use recursion, think of how a factorial is calculated).

not being funny but thats the part of the prblem i knew how to do.
if i have it correct recursion is a function calling itself
have written a factorial program before but just used a while loop

Think the problem here is not telling the computer how to answer my question
the problem is i dont know what the question is

Here the recursion idea is that you start with a vector of digits v_in to pick from and an empty vector of digits v_out where a combination can be put. Then at this point any one of the digits you have in v_in can be placed in the next slot of v_out to start a new combination. So you can loop for every digit in v_in, add it with v_out to get v_next, copy all the other digits of v_in into v_remain, and recursively call back the same function with v_next -> v_out and v_remain -> v_in. Once there is no more digits in v_in, you should have a full combination, and you just print it out with cout.

thanks for the help but think this is just beyond me at the moment
need to do some more reading i think
was following some of your explanation but go lost
need to learn more about recursion and functions
THANKS FOR THE HELP

you can always use the next_permutation function located in <algorithm>. As mike said you will need to break up then number into each digit and put them into some kind of container. Vectors work well for this. then you will need to sort the container to have the smallest digit at the front of the array. Then you can use a counter variable and a while statement to add up all of the permutations you can get.

int counter = 0;
vector<int> container; // put each digit here
// sort the vector
while(next_permutation(container.begin(), container.end())
{
counter++;
}
// now counter has the number of permutations

thanks guys
next_permutation did the job nicely
now gonna go and find out how it works
feel like i should know how to write my own algorithms
this might slow my learning but hate using something i dont understand
just me being me :)

Hello, I work at the U.S. Department of Labor. I am a maintenance prorgrammer of C code, and the configuration management of this code in the past has been very ...

Please I have an autocomplete textbox which fetches value from a tabe in the database. But after i choose the name i want to get the id of the value ...