Arrays

Arrays

11th Grade

10 Qs

quiz-placeholder

Similar activities

Array Java

Array Java

University

15 Qs

Array

Array

University

12 Qs

OOP - Quiz

OOP - Quiz

University

15 Qs

SLG IPC Week 7

SLG IPC Week 7

University

13 Qs

Unit 6 Arrays

Unit 6 Arrays

10th - 12th Grade

14 Qs

AP Computer Science A

AP Computer Science A

12th Grade

10 Qs

AP CS A Unit 6 Quiz PRACTICE

AP CS A Unit 6 Quiz PRACTICE

9th - 12th Grade

10 Qs

Java arrays

Java arrays

University

7 Qs

Arrays

Arrays

Assessment

Quiz

Computers

11th Grade

Medium

Created by

Ilakkiya N

Used 6+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly declares an array of 10 integers in C?

int arr(10);

int arr[10];

array int arr[10];

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about arrays is TRUE in C?

Arrays can hold different data types.

The size of an array can be changed during execution.

An array stores elements of the same type in contiguous memory.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the first element in a C array?

0

1

-1

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to initialize all elements of an array to zero in C?

int arr[5] = (0);

int arr[5] = {0};

int arr[5] = 0;

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How are arrays stored in memory?

All elements are stored in a contiguous block of memory.

Each element is stored at a random memory location.

Elements are dynamically linked to the next element in memory.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid array declaration?


int arr[10];

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

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

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output?

#include <stdio.h>

int main()

{

int arr[2];

arr[0] = 1;

arr[1] = arr[0] + 1;

printf("%d", arr[1]);

return 0;

}

0

1

2

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?