Loops coding challenges

Practise loops with 8 coding challenges, from easy to hard. Every challenge runs in your browser with instant tests, an AI review of your code and community solutions to compare.

Easy · 8

Skills you'll practise: 2D arraysAccumulatorsBuilding listsCountingDivisibilityFor loopsIterationListsLoop optimizationMultiplesNested loopsReverse loops
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
226
Challenges
2
Solutions shared
3
Languages

All challenges

Search by topic, language, or difficulty.

8 challenges
Easy

Fibonacci Number

Return the n-th Fibonacci number.

You'll learn IterationUpdating two variables
BeginnerLoopsSequencesStudent-beginner
No solutions yet
Easy

Prime Number Check

Decide whether a number is prime.

You'll learn DivisibilityLoop optimization
BeginnerLoopsNumbersStudent-beginner
No solutions yet
Easy

Halve Until One

Count how many halvings bring a number down to 1.

You'll learn While loopsCounting
BeginnerLearning-pathLoops
No solutions yet
Easy

Sum of Odd Numbers

Add every odd number up to a limit.

You'll learn For loopsAccumulators
BeginnerLearning-pathLoops
No solutions yet
Easy

Power by Repeated Multiplication

Raise a number to a power with a loop.

You'll learn Running productZero exponent
BeginnerLearning-pathLoops
No solutions yet
Easy

Multiplication Table Row

List the first multiples of a number.

You'll learn MultiplesBuilding lists
BeginnerLearning-pathLoops
No solutions yet
Easy

Countdown to Liftoff

Count down from a number and end with Liftoff!

You'll learn Reverse loopsLists
BeginnerLearning-pathLoops
No solutions yet
Easy

Flatten a 2D Array

Combine the rows of a 2D integer array into one array.

You'll learn 2D arraysNested loops
ArraysLoops
No solutions yet