well you are calling the function fun. you can't do the incrementing first and second stuf without calling fun.

Think of it this way., The program starts with the function main..and it runs some code and then sees the line fun(...). Then it goes...ok I need to run the function fun. So it leaves the main function and enters the fun function and then runs the code in there (ie. the incrementing) code. And then it returns back to the main function and continues until there is nothing left to run.