Tuesday, September 15, 2009

Lab 07

Write a program to read a list of words and to display the longest word (the one has longest length). The user indicates the end of the input by entering "done" (ignore cases).

Example output:

Please enter a list of words, enter "done" to stop:

cat

milk

computer

Hi

java

done

The longest word is: computer

Have fun! =)

No comments: