Study this flowchart and use it to answer the questions that follow.
Start
Set S=1
Ready
Repeat
Y= Y/10
S= S+1
Y= Y/10
End while
Display S
Stop
a) Give the expected output from the flow chart when the value of Y is:
i) 48
ii) 9170
iii) 800
b) Write the pseudocode that can be used to create a program represented by the
above flow chart.
Answer:
a)
i) 1
ii) 3
iii) 1
b)
Start
S=1
Ready
Repeat y
Y= Y/10
If y<10 then S=S+1
End if
UNTIL Y<10
Print s
Stop