Accenture interview question

Logic questions and some c++