455,513 Members | 1,653 Online
Need help? Post your question and get tips & solutions from a community of 455,513 IT Pros & Developers. It's quick & easy.

# How to print permutations?

 P: n/a If we have three variables a,b,c...which are char variables....then hoe to print there all permutations? for example....abc, bac, cab.......all of them.... May 25 '07 #1
5 Replies

 P: n/a On 25 Maj, 14:44, Shraddha

 P: n/a "Shraddha" writes: If we have three variables a,b,c...which are char variables....then hoe to print there all permutations? for example....abc, bac, cab.......all of them.... Use std::next_permutation() in . May 25 '07 #3

 P: n/a Shraddha wrote: If we have three variables a,b,c...which are char variables....then hoe to print there all permutations? for example....abc, bac, cab.......all of them.... Are all of these questions school work or something? May 25 '07 #4

 P: n/a On May 25, 5:50 pm, Deniz Dogan

 P: n/a Shraddha wrote: On May 25, 5:50 pm, Deniz Dogan Shraddha wrote: >>If we have three variables a,b,c...which are char variables....thenhoe to print there all permutations?for example....abc, bac, cab.......all of them.... Are all of these questions school work or something? Hi Deniz... This is not a school work... Actually these permutations are not supposed to be printed mannually. There is a formula for that permutations....b'coz of which we can do that program within 5-7 lines...that works not only for 3 variables but for n number of characters. But I am not aware of that formula...so I just want to know that formula.... http://www.von-oppen.com/doc/cuj/htm...son/nelson.htm It has the 'formula' you want (actually the algorithm) if you are prepared to do a little work and actually understand. john May 26 '07 #6

### This discussion thread is closed

Replies have been disabled for this discussion.