Mphasis interview question

basic coding Question using any preferable language