IBM interview question

Basic programming qstns