Task: Printing a Sequence
Tehtävä
Swipe to start coding
Write a program that prints the first ten even numbers.
- Create a
forloop with these parameters:- Initialization: start
iat1. - Condition: continue the loop while
i <= 10. - Update: increase
iby1after each iteration.
- Initialization: start
- Inside the loop, use
console.logto print the value ofi * 2. This will display the first ten even numbers (2, 4, 6, …, 20).
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 68
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 1.33
Task: Printing a Sequence
Pyyhkäise näyttääksesi valikon
Tehtävä
Swipe to start coding
Write a program that prints the first ten even numbers.
- Create a
forloop with these parameters:- Initialization: start
iat1. - Condition: continue the loop while
i <= 10. - Update: increase
iby1after each iteration.
- Initialization: start
- Inside the loop, use
console.logto print the value ofi * 2. This will display the first ten even numbers (2, 4, 6, …, 20).
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 68
single