Answer to Question #59477 in C++ for Salem
using namespace std;
void swap(char *x, char *y)
temp = *x;
*x = *y;
*y = temp;
void permute(char *a, int l, int r)
if (l == r)
cout << "A" << a << endl;
for (i = l; i <= r; i++)
permute(a, l+1, r);
char str = "BCDEF";
int n = strlen(str);
permute(str, 0, n-1);
How can I make it work correct?
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Unfortunately, your question requires a lot of work and cannot be done for free.
Please submit it with all requirements as an assignment to our control panel and
we'll assist you.
P(6,4)=360 that means we should get 360 different ways to list all the letters "ABCDEF" were A appears before D. This code just prints 18 outputs !!