Question
String Practice Problems Problem 2: Write a full program (starting from #include) that asks the user to type in 10 words, prompting the user for
String Practice Problems
Problem 2:
Write a full program (starting from #include) that asks the user to type in 10 words, prompting the user for each word with a number. The program then reports the longest word the user typed in. A sample output is shown below, with the user input shown in italic print.
Enter word #1: Gandalf Enter word #2: hobbit Enter word #3: Frodo Enter word #4: orc Enter word #5: antidisestablishmententarianism Enter word #6: Sauron
Enter word #7: ringEnter word #8: Sam Enter word #9: Legolas Enter word #10: Aragorn The longest word is antidisestablishmententarianism. To receive full credit, you must use a while loop. Do not write 10 cin statements.
Could you please be kind enough and answer in detail?
Thank you for ereading this and have a good one!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started