Smart keypad-1 test case problem

why my second test case is being not passed with this code ??

#include
using namespace std;

char keypad[][10] = { " ", “.+@$”, “abc”, “def”, “ghi”, “jkl” , “mno”, “pqrs” , “tuv”, “wxyz” };

void printKeypadString(char *inp,char *out,int i,int j){
if(inp[i]==’\0’){
out[j]=’\0’;
cout<<out<<" ";
return;
}

int digit =inp[i]-'0';
if(digit ==0){
	printKeypadString(inp,out,i+1,j);
}
for(int k=0;keypad[digit][k]!='\0';k++){
	out[j]=keypad[digit][k];
	printKeypadString(inp,out,i+1,j+1);
}

}

int main() {

char inp[20];
char out[20];

cin>>inp;

printKeypadString(inp,out,0,0);
return 0;

}

Please save your code on ide.codingblocks.com and then share its link.

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.