Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Filter Even Numbers | While and Do-While Loops: Control and Flexibility
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Loops Practice

bookChallenge: Filter Even Numbers

Opgave

Swipe to start coding

Write a function that prints only the odd numbers from the provided array using a while loop and the continue statement.

  • Loop through each element in the numbers array using a while loop.
  • Use the continue statement to skip any even numbers.
  • Print each odd number to the console.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 6
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

bookChallenge: Filter Even Numbers

Stryg for at vise menuen

Opgave

Swipe to start coding

Write a function that prints only the odd numbers from the provided array using a while loop and the continue statement.

  • Loop through each element in the numbers array using a while loop.
  • Use the continue statement to skip any even numbers.
  • Print each odd number to the console.

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 2. Kapitel 6
single

single

some-alt