Seksjon 1. Kapittel 12
single
Challenge: Filter Even Numbers
Sveip for å vise menyen
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 12
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår