What is an array in C++?

C++ Arrays Quiz

Quiz
•
Education
•
University
•
Easy
Инаят Нургали
Used 2+ times
FREE Resource
60 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
How do you declare an integer array of size 5 in C++?
int array[5];
array
int array = {5};
int array[];
3.
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
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
30 sec • 1 pt
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
30 sec • 1 pt
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
30 sec • 1 pt
What will be the output of the following code? int arr[] = {10, 20, 30, 40}; cout << arr[2];
30
10
20
40
Create a free account and access millions of resources
Similar Resources on Quizizz
56 questions
[MD2]_React_Hackathon03

Quiz
•
University
62 questions
KHTN 6 giữa học kì 1

Quiz
•
University
60 questions
CCI ( Cerdas Cermat Islami )

Quiz
•
University
60 questions
Prof Ed 5

Quiz
•
University
61 questions
[Module 1] Final Javascript Quizz

Quiz
•
University
60 questions
untitled Ta

Quiz
•
2nd Grade - University
64 questions
Lets learn our ABC s

Quiz
•
KG - Professional Dev...
61 questions
Zarządzanie projektami high-tech

Quiz
•
University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade