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.

Respuesta :

Answer:

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.