Start learning free

LESSON 159 OF 674 · LOOPS & CONDITIONALS

Print Even - Odd

Practice

Given a positive integer n, for each number from 0 to n - 1, print "odd" if the number is odd or the number itself if it is even.

Example:

Input: n = 6
Output (console):
0
odd
2
odd
4
odd

Note: You have to print to the console, your function shouldn't return anything.

STEP 1 OF 3
    Ctrl + Enter to check