Search Header Logo

Quiz on One-Dimensional and Two-Dimensional Arrays

Authored by John Escol

Other

University

Used 1+ times

Quiz on One-Dimensional and Two-Dimensional Arrays
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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;

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?