Mobiloitte interview question

simple question from Java and c