Challenge: 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?
Tak for dine kommentarer!
Sektion 2. Kapitel 6
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Awesome!
Completion rate improved to 5.56
Challenge: 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
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 6
single