Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Countdown Timer 7 | PHP Loops: for, while, foreach
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
PHP Loops & Iteration

bookChallenge: Countdown Timer 7

Task

Swipe to start coding

Write a function that performs a countdown from 10 to 1 and then prints a message.

  • Use a while loop to print each number from 10 down to 1, one per line.
  • After the countdown, print the message "Blast off!" on a new line.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 4
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Countdown Timer 7

Swipe to show menu

Task

Swipe to start coding

Write a function that performs a countdown from 10 to 1 and then prints a message.

  • Use a while loop to print each number from 10 down to 1, one per line.
  • After the countdown, print the message "Blast off!" on a new line.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 4
single

single

some-alt