Go line by line
first $a's$ value incremented & $a$ becomes $2$
then,
$printf("\%d",a); \rightarrow$ prints $2$
$if(a<=3)\rightarrow$ true
$main()\rightarrow$ at this point the stack will look like
$++a\rightarrow$ $a$ becomes $3$
$printf("\%d",a);\rightarrow$ prints $3$
$if(a<=3)\rightarrow true$
$main() \rightarrow$ at this point stack will looks like
$++a\rightarrow$ $a$ becomes $4$
$printf("\%d",a);\rightarrow$ prints $4$
$if(a<=3)\rightarrow false$
$printf("\%d",a);\rightarrow$ prints $4$
Now, at this point stack will looks like Only 1 line (last line ) left to read
$printf("\%d",a);\rightarrow$ prints $4$
Now, stack will looks like Only last line left to execute
$printf("\%d",a)\rightarrow$ prints $4$
∴ Final output will be $234444$ .
The recursion tree will be look like:
$output \rightarrow 234444$