Not able to solve this problem

how to use iteration and recursion both in this code

Algorithm:

  1. Map the number with its string of probable alphabets, i.e 2 with β€œabc”, 3 with β€œdef” etc. You can use
    string table[] = { " ", ".+@$", "abc", "def", "ghi", "jkl" , "mno", "pqrs" , "tuv", "wxyz" };
  2. create a recursive function which takes following parameters, output string, number array, current index and length of number array
  3. If the current index is equal to the length of number array then print the output string.
  4. Extract the string at digit[current_index] from the Map, where digit is the input number array.
  5. Run a loop to traverse the string from start to end
  6. For every index again call the recursive function with the output string concatenated with the ith character of the string and the current_index + 1.

you Can take help from this Reference Code

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course

https://ide.codingblocks.com/s/242378 concatenated string not get printed

if(i==input.length())
{
cout<<output<<endl;
return;
}
you have to go till end not till end-1

now it will work check

thanks for help. now it is working fine