Ask Question
13 May, 10:04

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.

+2
Answers (1)
  1. 13 May, 12:03
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers