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.