How to print the 2nd part of the ans?

How can I print the no of permutations?

hi @kodivine0 you can keep a count variable as an argument and everytime you print a permutation you can increment that variable.

i have taken variable as parameter but my output is incorrect. Please help me

@kodivine0 please share the updated code

@kodivine0 https://ide.codingblocks.com/s/256507 you can refer to this. I passed by reference and updated its value in the base case. The problem with your code was that it did not have a return statement in its base case, and since you were passing c+1 as an argument, it’d gain its old value in the previous function call and never be updated.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.