(1) The algorithm updates the value of x while i repeats from 0 to 20. The value of x is 10 until i becomes 18, and then x becomes 0 when i is 20. Finally, it increments i by 2 and outputs the result since i no longer meets the loop condition (i<=20). This algorithm receives input i=0, x=1 and terminates with the correct output i=22, x=0.