NTT DATA Interview Question

write code on paper and be correct for syntax