This question concerns a recursive function i have to write. its basically has to take a number in that will represent the the number of times you flip a coin. I need a way to print out all possible solutions.

So for example say the user puts in 1, the output would be ' HT '.

input is 2 so it prints hh tt th ht etc.

What it does is takes in a number from the user and outputs the possible

so far ive come up with

Code:

int coin(int x)
{
if(x==0)
return;
else
{
return coin(x-1);
}

QUESTION NOW IS:

How would i print out the possible solutions. I was thinking something like strcat adding the letters but im not really sure how to proceed from where i am?