Sample Exercises

Basic: Sort Words

Return to exercise list

Write a program that asks the user to enter a list of words. Sort the list and print the sorted results. Do not use a loop to do this exercise. Sample output:

  Please enter several words: perl is so much fun!
  In sorted order: fun! is much perl so

Solution for Sort Words

Solution