ThinkLABS interview question

Very basic electroincs, c programming