NTT DATA interview question

Basics of c c++ java logical reason