
C++ Arrays Quiz
Authored by cjdsjv vjds acssacascas
Information Technology (IT)
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
62 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What is an array in C++?
A collection of elements of the same type stored in contiguous memory locations
A single variable that holds multiple values of different types
A function that performs calculations
A keyword for declaring variables
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the index of the first element in an array?
0
1
-1
Depends on the array size
3.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
How do you declare an integer array of size 5 in C++?
int array[5];
array
int array = {5};
int array[];
4.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What will happen if you access an array index that is out of bounds?
Undefined behavior
The program will crash
It will return 0 by default
Compiler error
5.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
Which of the following is NOT a valid array declaration?
double data[] = new double[5];
int arr[5];
float numbers[10];
char str[20];
6.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
Which statement correctly initializes an array?
int arr[3] = {1, 2, 3};
int arr = {1, 2, 3};
arr[3] = {1, 2, 3};
int arr[3]; arr = {1, 2, 3};
7.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What will be the output of the following code? int arr[] = {10, 20, 30, 40}; cout << arr[2];
30
10
20
40
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
5 questions
What is Presidents' Day?
Interactive video
•
10th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
20 questions
Mardi Gras History
Quiz
•
6th Grade - University
10 questions
The Roaring 20's Crash Course US History
Interactive video
•
11th Grade - University
17 questions
Review9_TEACHER
Quiz
•
University