Understanding 1D Arrays in C

Understanding 1D Arrays in C

12th Grade

25 Qs

quiz-placeholder

Similar activities

QUIZ 2 (FINALS)

QUIZ 2 (FINALS)

12th Grade

20 Qs

Quiz tentang App Inventor

Quiz tentang App Inventor

11th Grade - University

21 Qs

Quiz 1 on Artificial Intelligence

Quiz 1 on Artificial Intelligence

12th Grade

20 Qs

Питон П411

Питон П411

9th - 12th Grade

20 Qs

Professionalism in Robotics Engineering Final Assessment

Professionalism in Robotics Engineering Final Assessment

9th Grade - University

20 Qs

SUMMATIVE TEST IN COMPUTER 5

SUMMATIVE TEST IN COMPUTER 5

5th Grade - University

20 Qs

Design Principles Quiz

Design Principles Quiz

7th Grade - University

20 Qs

Code Camp Quiz 2025 V1

Code Camp Quiz 2025 V1

6th Grade - University

20 Qs

Understanding 1D Arrays in C

Understanding 1D Arrays in C

Assessment

Quiz

Information Technology (IT)

12th Grade

Practice Problem

Medium

Created by

Ayush Tiwari

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to declare a 1D array in C?

int[10] arr;

int arr[10];

array int arr[10];

int arr(10);

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you initialize a 1D array with specific values in C?

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

int arr(5) = {1, 2, 3, 4, 5};

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

int arr = {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?

-1

1

5

0

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you access the third element of an array named 'arr'?

arr[1]

arr[2]

arr[3]

arr.get(2)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What function can be used to determine the length of an array in C?

count(array)

length(array)

array.length()

sizeof(array) / sizeof(array[0])

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you iterate through all elements of a 1D array using a for loop?

for (int i = 0; i < array.length; i += 2) { /* process array[i] */ }

for (int i = 0; i < array.length - 1; i++) { /* process array[i] */ }

for (int i = 1; i <= array.length; i++) { /* process array[i] */ }

for (int i = 0; i < array.length; i++) { /* process array[i] */ }

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if you try to access an array element with an index out of bounds?

The program will run without any issues.

The array will automatically resize to accommodate the index.

The value at the last index will be returned.

An error or exception will occur.

Create a free account and access millions of resources

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?