Pergunta de entrevista da empresa Dialog Semiconductor

Showed be a C++ code and asked me to give the solution.