Challenge: Print Odd Numbers
Tehtävä
Swipe to start coding
Write a program that prints all odd numbers from 1 to 20 using a for loop with a custom step.
- Use a for loop to iterate through numbers starting at 1 and ending before 20.
- Set the step value in the loop so that only odd numbers are processed.
- Print each odd number on a new line.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 2
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 5.56
Challenge: Print Odd Numbers
Pyyhkäise näyttääksesi valikon
Tehtävä
Swipe to start coding
Write a program that prints all odd numbers from 1 to 20 using a for loop with a custom step.
- Use a for loop to iterate through numbers starting at 1 and ending before 20.
- Set the step value in the loop so that only odd numbers are processed.
- Print each odd number on a new line.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 2
single