Q. Following is an algorithm to classify numbers as “Single Digit”, “Double Digit” or “Big”.

Classify_Numbers_Algo


INPUT Number

IF Number < 9

"Single Digit"

Else If Number < 99

  "Double Digit"

  Else

   "Big"


Verify for (5, 9, 47, 99, 100 200) and correct the algorithm if required.


Answer :-

Correct algorithm is

INPUT Number
IF Number < 10
"Single Digit"
  Else If Number < 100
    "Double Digit"
      Else
         "Big"

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post