Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
Write a loop that iterates through an array of 5 numbers and prints each number.
You can use the index 'i' to access each element.
What is the index of the first element in an array?
Remember, indexing starts at zero.
What does traversing an array mean?
Think about what we do when we want to read or manipulate all data in an array.
True or False: The index of the last element in an array of size 5 is 5.
Use the size of the array to calculate the last valid index.
Write a function that takes an array of integers and returns the maximum value by traversing the array.
Consider how you might initiate your max variable.
Create a two-dimensional array and write a function that prints all the elements in a zigzag pattern.
What effect does changing the direction on each row have?
5 more questions in this section. Enroll free to practise them all.
Enroll free