Sektion 1. Kapitel 12
single
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 1. Kapitel 12
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