
Quiz PF Topic 4 Array

Quiz
•
Computers
•
12th Grade
•
Medium

Athirah Musa
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to declare an array of integers in C++?
int array[10];
array int[10];
int[10] array;
int array(10);
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you initialize an array with the values 1, 2, 3, 4, 5 in C++?
int arr[] = {1, 2, 3, 4, 5};
int arr[5] = {1, 2, 3, 4, 5};
Both int arr[] = {1, 2, 3, 4, 5}; & int arr[5] = {1, 2, 3, 4, 5};
int arr(5) = {1, 2, 3, 4, 5};
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the index of the first element in a C++ array?
0
1
-1
Depends on the array size
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements correctly accesses the third element of an array named arr?
arr[2]
arr(3)
arr{}
arr[3]
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
int arr[5] = {1, 2, 3, 4, 5};
cout << arr[1] + arr[3];
5
6
7
8
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code output?
int arr[3] = {1, 2, 3};
cout << arr[1];
1
2
3
0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare an integer array of size 5 in C++?
int array[5];
array int[5];
int[5] array;
int array(5);
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Java - arrays and String methods

Quiz
•
9th - 12th Grade
10 questions
Programming Basics

Quiz
•
11th - 12th Grade
13 questions
AL-Two-Dimensional Array

Quiz
•
9th - 12th Grade
12 questions
Linguagem C parte II

Quiz
•
12th Grade
10 questions
Arrays e Manipulação de Strings em C

Quiz
•
12th Grade
15 questions
Javascript

Quiz
•
10th - 12th Grade
10 questions
Programming - Arrays

Quiz
•
2nd - 12th Grade
10 questions
Python Data Types

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade