The program defined the following variables:
- P array of size 8 containing zeros (inputs 1 to 8)
- integer integer variables n, i
The following command segment is executed:
I = 8
Do until n = 0
P (I) = n mod 2
N = n / 2
I = i-1
- What does this section do?
- What are the conditions for the correctness of the code?
- What order will the plan fall into if one of the following options does not exist:
A. do until n = 0
B. p (i) = n mod 2
C. N = n / 2
D. I = i-1
- What will be printed for input 147?