Exercise Set#6

on Monday, February 8, 2010
Exercise 1 - Start to End
Write a program that asks the user for a starting value and an ending value and then writes all the integers (inclusive) between those two values.

Start: 5
End: 9

5
6
7
8
9

Exercise 2 - N Times Words
Write a program that asks the user to enter a word. The program will then repeat word for as many times as it has characters:

Word: Hello

Hello
Hello
Hello
Hello
Hello

Exercise 3 - Thirty Characters
Write a program that asks the user to enter two words. The program then prints out both words on one line. The words will be separated by enought dots so that the total line length is 30:

First word: turtle
Second word: 153

turtle....................153

3 comments:

Post a Comment