Wipro Interview Question

PROGRAMMING ABILITY (ONLY LOGIC)