Answer:
A) while (num >= 0)
Explanation:
To understand why we need to focus on the module and division operation inside the loop. num % 10 divide the number by ten and take its remainder to then add this remainder to sum, the important here is that we are adding up the number in reverse order and wee need to repeat this process until we get the first number (1%10 = 1), therefore, num need to be one to compute the last operation.
A) this is the correct option because num = 1 > 0 and the last operation will be performed, and after the last operation, num = 1 will be divided by 10 resulting in 0 and 0 is not greater than 0, therefore, the cycle end and the result will be printed.
B) This can not be the option because this way the program will never ends -> 0%10 = 0 and num = 0/10 = 0
C) This can not be the option because num = 1 > 1 will produce an early end of the loop printing an incomplete result
D) The same problem than C
E) There is a point, before the operations finish, where sum > num, this will produce an early end of the loop, printing an incomplete result