Infosys BPM Interview Question

i asked me to write a code.