IBM Interview Question

Simple programming ques