Anonymous interview question

Some questions based on for loop and while loop