Challenge: Filter Even Numbers
Task
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.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 5.56
Challenge: Filter Even Numbers
Swipe to show menu
Task
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.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 6
single