Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Print Odd Numbers | For Loops: Fundamentals and Applications
C# Loops Practice

bookChallenge: Print Odd Numbers

Opgave

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.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 2
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

Awesome!

Completion rate improved to 5.56

bookChallenge: Print Odd Numbers

Stryg for at vise menuen

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 2
single

single

some-alt