Qualcomm Interview Question

correct the errors of a given code