a algorithm whether a number is a single digit number,
two-digit number, three-digit number, four-digit number or just more than four-digit number
Answers
Answered by
1
Answer:
For the above given algorithm the input 9 and 99 will give wrong output.
For input 9 the above algorithm will give ‘Double Digit’ as the condition for a single digit written as Number < 9.
Same for 99 the above algorithm will give ‘Big’ as the condition for double digit written as Number < 99.
Correct Algorithm:
INPUT Number
IF Number <= 9
"Single Digit"
Else If Number <= 99
"Double Digit"
Else
"Big"
Similar questions