Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is the output of cout << marks[1]; if marks is initialized as int marks[5] = {90, 85, 78, 92, 88};?
Remember, indexing starts at 0.
How would you access the second element in an array called data?
Consider the zero-indexing rule.
What is the correct way to access the first element of an array named 'scores'?
Remember the indexing starts at 0.
True or False: You can access a two-dimensional array's elements using one index only.
Think about how the dimensions relate to accessing elements.
Write a program that initializes a 3x3 matrix with random values and prints out each value in a well-formatted manner. Explain how elements are accessed.
Consider how you can apply nested loops for both rows and columns.
Given a one-dimensional array that represents temperatures for a week, write a function that finds the highest temperature. Explain your method of accessing each element.
Think about how you can retain the maximum value as you loop.
4 more questions in this section. Enroll free to practise them all.
Enroll free