Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Print Odd Numbers | For Loops: Fundamentals and Applications
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Loops Practice

bookChallenge: 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ää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 2
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookChallenge: 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

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 2
single

single

some-alt