Kotlinlearncs.online LogoJava
Return to List

Solve: Print Every Other Element

Created By: Justin Maier
/ Version: 2024.9.0

Given an int array values with at least two elements, write a segment of code that prints out every other element of values, starting from the second element.

For example, if given the array {1, 2, 3, 4, 5, 6, 7} you should print 2, 4, then 6.

Related Lessons

Stuck? You may find these lessons helpful: