How does this code work?? I am at a loss how the tail recursion works here?
#include<iostream.h>
#include<conio.h>
void back(void);
void main(void)
{
cout<<"Enter a sentence: ";
back();
getch();
}
void back(void)
{
char ch;
ch=getche();
if (ch!='\r')
{back();
cout<<ch;//Read a character, print the rest of the input in reverse, then print that character"
}
else
cout<<"Output in reverse order is: \n";
}