Search Header Logo

2nd year ch#5 arrays

Authored by PDCS Server

Computers

12th Grade

Used 4+ times

2nd year ch#5 arrays
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an array in programming?

A variable that stores a single value
A collection of variables of the same type
A data structure that stores different types
A sequence of instructions

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is an array declared in C++?

array<int, size> arr;
arr[size]
int arr[size];
int[size] arr;

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the size of an array determine?

The number of elements it can store
The type of elements it can store
The memory location it occupies
The operations it can perform

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How are array elements accessed in C++?

Sequentially
Using pointer arithmetic
By their memory addresses
Using their indices

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the first element in an array?

0
1
-1
Depends on array size

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is an array initialized in C++ with constant values?

int arr[] = {1, 2, 3};
arr = {1, 2, 3};
arr = [1, 2, 3];
int arr[3] = {1, 2, 3};

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you access the last element of an array arr with size n in C++?

arr[n-1]
arr[n]
arr[0]
arr[n+1]

Access all questions and much more by creating a free account

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

Already have an account?