I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
Introduction – Counter loops

Learn

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

Try

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

Challenge

Write a program that will display odd numbers between 1 and 50.

Hint – consider the pattern…

Test

Try the following quiz to test your knowledge.

Tasks to try

Challenge task

Comments are closed.

Information