Majesco Interview Question

Basic code exercise for writing a code