3 section

3 section

10th Grade

9 Qs

quiz-placeholder

Similar activities

C# 11

C# 11

1st - 10th Grade

10 Qs

APCSA Unit 6

APCSA Unit 6

10th - 12th Grade

14 Qs

APCSA Unit 6.2

APCSA Unit 6.2

10th - 12th Grade

14 Qs

AP Computer Science Principles Arrays

AP Computer Science Principles Arrays

10th - 12th Grade

14 Qs

AP CSA Unit 6 Arrays

AP CSA Unit 6 Arrays

10th - 12th Grade

14 Qs

Arrays Unit

Arrays Unit

10th - 12th Grade

14 Qs

APCSA Unit 6 Arrays

APCSA Unit 6 Arrays

10th - 12th Grade

14 Qs

Java Arrays Quiz Review

Java Arrays Quiz Review

9th - 10th Grade

10 Qs

3 section

3 section

Assessment

Quiz

Computers

10th Grade

Hard

Created by

Ahmed Tarbosh

Used 1+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data types is used to store multiple values of the same data type in a single variable?

int

float

char

array

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is used to read a string with spaces in C++?

cin >> str;

getline(cin, str);

scanf("%s", str);

None of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to find the length of a string in C++?

str.length()

strlen(str)

size(str)

None of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is used to print the value of an array element at a particular index?

cout << array[index];

print(array[index]);

print array[index];

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid way to initialize an array in C++?

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

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

int arr[3] = {1};

int arr[3] = {};

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following operators is used to concatenate two strings in C++?

+

&

%

|

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet?

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

cout << arr[1];

1

2

3

Compilation error

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is used to access the last element of an array in C++?

arr[length-1]

arr[length]

arr[length+1]

arr[-1]

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid way to declare a variable in C++?

int num;

float num = 3.14;

char letter = 'a';

None of the above