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

bookChallenge: Print Odd Numbers

Task

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.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 2
single

single

Ask AI

expand

Ask AI

ChatGPT

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

close

Awesome!

Completion rate improved to 5.56

bookChallenge: Print Odd Numbers

Swipe to show menu

Task

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.

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

single

some-alt