Search for question
Question

Consider the following segment of pseudocode:

procedure (n int)

while n>20

n = n - floor (n/10)

print n

endwhile

(a) Write the output of the code on input n = 25. (b) On input n = 100, how many times is the command print n executed?

A. 15 C. 17 E. 19

B. 16 D. 18 F. none of (A)-(E).

Fig: 1

Fig: 2