Appareo Systems interview question

Coding exam question about loops