Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Random Multiple of 7 | Discovering Loops
Introduction to JavaScript

bookChallenge: Random Multiple of 7

Task

Swipe to start coding

You are given a starting number. Your task is to use a do-while loop to generate numbers starting from this value until you reach a multiple of 7.

Instructions

  1. Start with: let number = 3;
  2. Use a do-while loop that:
    • Adds the current number to an array.
    • Increments the number by 1.
    • Continues running while the previous number is not a multiple of 7.
  3. Return all generated numbers.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 6. ChapterΒ 6
single

single

Ask AI

expand

Ask AI

ChatGPT

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

close

bookChallenge: Random Multiple of 7

Swipe to show menu

Task

Swipe to start coding

You are given a starting number. Your task is to use a do-while loop to generate numbers starting from this value until you reach a multiple of 7.

Instructions

  1. Start with: let number = 3;
  2. Use a do-while loop that:
    • Adds the current number to an array.
    • Increments the number by 1.
    • Continues running while the previous number is not a multiple of 7.
  3. Return all generated numbers.

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Β 6. ChapterΒ 6
single

single

some-alt