Repetition
The each of following questions will require a very short program of about ten
line of code. You will write 5 different programs for this homework assignment.
For Loop Program (5 points)
Write a program using a for loop that outputs the numbers from
3 to 42 by 7.
While Loop Program(5 points)
Write a program using a while loop that puts the numbers from
97 to -4 by 9.
Do-While Loop Program(5 points)
Write a program using a do-while loop that outputs the numbers from
23 to 106 by 13
Conversion of Loops Program (5 points each function/loop and 5 points for main, 20 points)
Write a program that has three functions, forLoop(), whileLoop(), doWhileLoop().
Each function will have the appropriate loop that outputs the numbers from 5 to 25 by 5.
In your program main() will call forLoop(), which will call whileLoop(), which will call doWhileLoop.
You will not use arguments nor return any values, except for main().
UMBC |
CSEE