Exercise 1
Write a program which uses a “for” loop to print the first eight powers of two. Start from the first power of two (i.e., 2). Hand in a printed copy of the program, and a printed copy of the output.
Modify the program to get the power of two to print from the user.
Rewrite the program using a “while” loop.
Rewrite the program again using a “do-while” loop.