Challenge: Print a Sequence
Task
Swipe to start coding
Write a PHP function that prints all even numbers from 2 to 20, each on a new line.
- Use a for loop to generate numbers from 2 to 20.
- Check that each number is even.
- Print each even number on a new line.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 2
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 5.56
Challenge: Print a Sequence
Swipe to show menu
Task
Swipe to start coding
Write a PHP function that prints all even numbers from 2 to 20, each on a new line.
- Use a for loop to generate numbers from 2 to 20.
- Check that each number is even.
- Print each even number on a new line.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 2
single