Quiz on programming

need explanation of output of question 3,4,5…