Quiz on One-Dimensional and Two-Dimensional Arrays

Quiz on One-Dimensional and Two-Dimensional Arrays

University

19 Qs

quiz-placeholder

Similar activities

CS8391 Data Structure U.II

CS8391 Data Structure U.II

University

15 Qs

Midterm 2 Quiz

Midterm 2 Quiz

University

16 Qs

ambot para asa ni

ambot para asa ni

University

20 Qs

DATA STRUCTURE

DATA STRUCTURE

University

14 Qs

Together We Grow - 2

Together We Grow - 2

University

15 Qs

Javapie Quiz

Javapie Quiz

University

20 Qs

Java programming

Java programming

University

20 Qs

Logika & Algoritma Pemrograman

Logika & Algoritma Pemrograman

University

20 Qs

Quiz on One-Dimensional and Two-Dimensional Arrays

Quiz on One-Dimensional and Two-Dimensional Arrays

Assessment

Quiz

Other

University

Hard

Created by

John Escol

Used 1+ times

FREE Resource

19 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the starting index of a one-dimensional array in C?

-1

0

2

1

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax to declare a one-dimensional array?

array_name data_type[array_size];

array_name[] data_type;

data_type array_name[array_size];

data_type array_name[];

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the term 'initialization' refer to in the context of arrays?

Assigning values to the array

Updating array values

Accessing array elements

Declaring the array

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you initialize a one-dimensional array without specifying its size?

data_type array_name[] = {1, 2, 3};

data_type array_name = {1, 2, 3};

data_type array_name[3];

data_type array_name[3] = {1, 2, 3};

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the array subscript operator []?

To update an array

To initialize an array

To access elements of an array

To declare an array

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop can be used to initialize an array after its declaration?

for loop

if statement

switch case

do-while loop

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to update an element in a one-dimensional array?

array_name[index] = old_value;

new_value = array_name[index];

array_name[index] = value;

array_name[index] = new_value;

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?