Quiz PF Topic 4 Array

Quiz PF Topic 4 Array

12th Grade

10 Qs

quiz-placeholder

Similar activities

Unit 8 - Searching and Sorting

Unit 8 - Searching and Sorting

9th - 12th Grade

15 Qs

C Programming - Dia Aberto - EPC

C Programming - Dia Aberto - EPC

9th - 12th Grade

10 Qs

C++ Arrays

C++ Arrays

8th - 12th Grade

12 Qs

Advanced Java Study Guide

Advanced Java Study Guide

11th - 12th Grade

10 Qs

ARRAYS

ARRAYS

11th - 12th Grade

10 Qs

Unit 6 Computer Science Arrays

Unit 6 Computer Science Arrays

10th - 12th Grade

14 Qs

Quiz on Array

Quiz on Array

11th - 12th Grade

10 Qs

AP Computer Science Unit 10

AP Computer Science Unit 10

12th Grade

10 Qs

Quiz PF Topic 4 Array

Quiz PF Topic 4 Array

Assessment

Quiz

Computers

12th Grade

Medium

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?