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

bookChallenge: Print Odd Numbers

Tâche

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

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 2
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

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

Glissez pour afficher le menu

Tâche

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 desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 2
single

single

some-alt