Search Header Logo

One-Dimensional Arrays in C Quiz

Authored by Zemmary Batucan

Instructional Technology

10th Grade

Used 3+ times

One-Dimensional Arrays in C Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to declare an array named numbers that can hold 10 integer elements?

int numbers[10];

int numbers = 10;

int numbers(10);

int numbers[10] = {0};

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the last element in an array named colors with a size of 5?

0

1

4

5

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the value of the third element in an array named values?

values[2]

values[3]

values(2)

values(3)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax to assign the value 25 to the second element of an array named scores?

scores[1] = 25;

scores[2] = 25;

scores(1) = 25;

scores(2) = 25;

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the sizeof() operator when used with an array?

To determine the size of a single element in the array.

To determine the total number of elements in the array.

To determine the size of the array in bytes.

To determine the data type of the array.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid way to traverse an array in C?

Using a for loop.

Using a while loop.

Using a do-while loop.

Using a switch statement.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet? int numbers[5] = {10, 20, 30, 40, 50}; printf("%d", numbers[3]);

10

20

30

40

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?