I Haz Codes
While loops can be tricky to learn for beginner coders. Although, on face value, they are easy to understand, it is the different ways we can solve problems using them which people struggle with. The first lesson will cover the basic anatomy of while loops before going into how they can be used to solve problems.
The first type of loop we study is the counter (or counter controlled) loop
Write a program which will display the 12 times table. It should display each answer in a user readable way.
1 times 12 is 12
2 times 12 is 24
etc
Write a program that will display odd numbers between 1 and 50.
Hint – consider the pattern…
Try the following quiz to test your knowledge.