1) Initially main is called when i=5, i decremented to 4, for this hai will be printed after 2) executes
2) main is called, i=4, i decremented to 3, for this hai will be printed after 3) executes
3) main is called, i=3, i decremented to 2, for this hai will be printed after 4) executes
4) main is called, i=2, i decremented to 1, for this hai will be printed after 5) executes
5) main is called, i=1, i decremented to 0, and if not executed hence hai not printed.
--5 is executed so hai and 0 printed for 4) once
--4 is executed so hai and 0 printed for 3) twice
--3 is executed so hai and 0 printed for 2) thrice
--2 is executed so hai and 0 printed for 1) four times
--1 is executed so program terminated.
So total four times hai and 0 is printed