Loops and conditionals together

Given a comma-separated list of integers, print only the even ones — in the order they appear, space-separated.

If there are no even numbers, print nothing (empty line).

Input:  1,2,3,4,5,6
Output: 2 4 6

Constraints

  • Write the loop yourself — do not use a built-in filter function.
  • Output is space-separated on one line.
Ad SpaceGoogle AdSense active for guests & free-tier learners.