KnowledgeBoat Logo

Computer Science

Write an algorithm that performs the following:

Ask a user to enter a number.
If the number is between 5 and 15, write the word GREEN.
If the number is between 15 and 25, write the word BLUE.
If the number is between 25 and 35, write the word ORANGE.
If it is any other number, write that ALL COLORS ARE BEAUTIFUL.

Algo & Flowcharts

1 Like

Answer

Step 1: INPUT number

Step 2:

IF number is between 5 and 15 THEN
    PRINT "GREEN"
ELSE IF number is between 15 and 25 THEN
    PRINT "BLUE"
ELSE IF number is between 25 and 35 THEN
    PRINT "ORANGE"
ELSE
    PRINT "ALL COLORS ARE BEAUTIFUL"

Answered By

2 Likes


Related Questions