Search Header Logo

Lab8_Quiz

Authored by bme programming

Computers

University

Lab8_Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a one-dimensional array in C#?

int array[];

int[] array;

array int[];

int array();

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If an array is declared as int[] arr = new int[5];, what will arr.Length return?

4

6

5

0

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the first element in a single-dimensional array in C#?

0

1

-1

Depends on the array

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default value of an integer array element in C#?

1

0

null

Empty

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to create an array in C#?

array

new

create

declare

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output?

int[] arr = { 5, 10, 15, 20 };

Console.WriteLine(arr[2]);

5

10

15

20

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you initialize an array with values?

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

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

int[] arr =

new int[3] [1, 2, 3];

int[] arr =

new int[3] (1, 2, 3);

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?

Discover more resources for Computers