Ask Question

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. 4 March, 06:19
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers