NTT DATA interview question

Simple programming logics