C++ Arrays Quiz

C++ Arrays Quiz

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

AP Computer Science

AP Computer Science

12th Grade

10 Qs

C++ Quiz 4: Arrays and Vectors

C++ Quiz 4: Arrays and Vectors

7th - 12th Grade

7 Qs

One Dimensional Array

One Dimensional Array

11th Grade

10 Qs

Arrays Unit 6 AP CSA

Arrays Unit 6 AP CSA

10th - 12th Grade

14 Qs

Codehs Unit 6

Codehs Unit 6

10th - 12th Grade

14 Qs

Arrays Unit 6 Computer Science

Arrays Unit 6 Computer Science

10th - 12th Grade

14 Qs

AP CSA Java Arrays

AP CSA Java Arrays

10th - 12th Grade

14 Qs

JAVA array

JAVA array

12th Grade - University

10 Qs

C++ Arrays Quiz

C++ Arrays Quiz

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Ahmed Yaseen

Used 3+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an array in C++?

A collection of variables of different types

A collection of variables of the same type

A variable that holds multiple types

A dynamic data structure

2.

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 compiler

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare an array of 10 integers in C++?

`int arr[10];`

`array arr(10);`

`int arr = new int[10];`

`int[] arr = new int[10];`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following accesses the 5th element of an array `arr` in C++?

`arr[5]`

`arr[4]`

`arr[6]`

`arr[0]`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if you try to print an element outside the bounds of an array in C++?

هيحصل ايه لو حاولت انك تطبع عنصر بره الرينج بتاع الاراي

It will return 0

It will return garbage value

It will throw an error

The program will stop executing

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the size of an array declared as `int arr[10];` in C++?

9

10

Undefined

Depends on the elements

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes a 2D array in C++?

An array of arrays

A dynamic structure

A collection of different data types

A single-dimensional array

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?