Arrays C++- CS 172 Exercise #1
Flashcard
•
Science, Computers
•
8th - 12th Grade
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

15 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What is an array in C++?
Back
An array is a collection of elements of the same data type stored in contiguous memory locations, allowing for efficient access and manipulation.
2.
FLASHCARD QUESTION
Front
What is the syntax to declare an array of integers in C++?
Back
int arrayName[size]; where 'size' is the number of elements in the array.
3.
FLASHCARD QUESTION
Front
What is the first legal subscript for an array in C++?
Back
0, as C++ uses zero-based indexing.
4.
FLASHCARD QUESTION
Front
What is the last legal subscript for an array declared as int values[5]?
Back
4, because the valid indices are 0 to 4.
5.
FLASHCARD QUESTION
Front
How do you access the third element of an array named 'numbers'?
Back
You can access it using numbers[2], since indexing starts at 0.
6.
FLASHCARD QUESTION
Front
What will the following code display? int numbers[5] = {99, 87, 66, 55, 101}; cout << numbers[1];
Back
87, as it accesses the second element of the array.
7.
FLASHCARD QUESTION
Front
What is the difference between an array and a variable in C++?
Back
An array can hold multiple values of the same type, while a variable holds a single value.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
2025 S3/4 CCKS Enzymes
Flashcard
•
8th Grade - University
10 questions
Disney descendants flashcard
Flashcard
•
KG
11 questions
Unit 1 | Topic 2 | Key Terms - Flashcards
Flashcard
•
9th - 12th Grade
8 questions
MAT_8_EF_QN01-QN08
Flashcard
•
8th Grade - University
15 questions
Function Operations and Composite Functions
Flashcard
•
9th Grade - University
15 questions
Evolution Review 1
Flashcard
•
7th Grade - University
15 questions
Stats Units 1-4 Mixed Review
Flashcard
•
7th Grade - University
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Science
20 questions
Physical and Chemical Changes
Quiz
•
8th Grade
10 questions
Exploring Newton's Laws of Motion
Interactive video
•
6th - 10th Grade
20 questions
Balanced and Unbalanced Forces
Quiz
•
6th - 8th Grade
20 questions
Galaxies
Quiz
•
8th Grade
22 questions
Plate Tectonics
Lesson
•
6th - 8th Grade
10 questions
Unit 2: LS.Bio.1.5-LS.Bio.2.2 Power Vocab
Quiz
•
9th - 12th Grade
9 questions
Conduction, Convection, and Radiation
Lesson
•
6th - 8th Grade
20 questions
Life Cycle of a Star
Quiz
•
8th Grade