Ask Question
20 February, 09:45

Write an algorithm that receives fruit names from user and prints them on the screen. This algorithm should keep receiving fruit names and printing them on the screen until the user enters 'X' as the fruit name. Upon entering 'X' you should exit from the algorithm.

+3
Answers (1)
  1. 20 February, 13:11
    0
    Algorithm:

    1. Create a string variable "fruit_name".

    2. Do

    2.1 read the fruit name from user.

    2.2 print the fruit name.

    2.3 if fruit_name==X

    2.4 break

    3. while (fruit_name!="X")

    4. end program

    Explanation:

    Create a variable to store the fruit name. Read name of a fruit from user and print the fruit name. Again ask user to enter fruit name. Repeat this until user enter "X" as fruit name. if fruit name is "X" then break the loop.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write an algorithm that receives fruit names from user and prints them on the screen. This algorithm should keep receiving fruit names and ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers