Exercises

September 25, 2006

To ensure that you receive appropriate laboratory credit, for each exercise make sure that I have looked at your source code and seen a demonstration of your working program.
  1. Write a for or while loop to print a string backwards.
  2. Write a program that prompts the user for two strings and determines the number of two-character sequences that appear in both the first and second strings. Exclude spaces in your comparison.
    “CS is cool” “the old cow” would have two matches “co” for “cool” and “cow” and “ol” for “cool” and “old”


Sami Rollins