Qualcomm interview question

correct the errors of a given code