Recursion flow in c language and how the output is printed
问题 How is the value of I getting printed? I know the recursion calls itself again and again. According to me, the function should return empty as the function is called before printing. How is the printf working? recur(int i) { if(i<0) return 0; recur(--i); printf("%d",i); recur(--i); } main() { recur(2); } The output of this program is -1 0 1 -1 Can someone explain how is it working? 回答1: To understand what happens, you have to understand how recursion works. Every recursive function requires a