Kotlinlearncs.online LogoJava
Return to List

Solve: Print Element of Array Function

Created By: Justin Maier
/ Version: 2025.9.0

Write a function printElement that takes two arguments:

  1. An array of ints.
  2. An int representing an index.

If the int argument represents a valid index in the array, print out the corresponding element. Otherwise, print "Invalid index".

Related Lessons

Stuck? You may find these lessons helpful: