Help me in solving PPSC225 problem

My issue

Explain this code correct or not

Learning course: Programming and Problem solving using C
Problem Link: https://www.codechef.com/learn/course/ciet-programming-c/CIETPC33/problems/PPSC225