Array and Loops in C#

Array and Loops in C#

University

20 Qs

quiz-placeholder

Similar activities

C Language Loop and Array Quiz

C Language Loop and Array Quiz

University

22 Qs

DATA STRUCTURE USING C

DATA STRUCTURE USING C

KG - University

15 Qs

ARRAYLIST - JAVA

ARRAYLIST - JAVA

University

15 Qs

Java Programming

Java Programming

University

15 Qs

C Language Array Quiz

C Language Array Quiz

University

19 Qs

Java Programming Quiz

Java Programming Quiz

University

17 Qs

C programming

C programming

University

15 Qs

C programming syntax quiz

C programming syntax quiz

University

20 Qs

Array and Loops in C#

Array and Loops in C#

Assessment

Quiz

Computers

University

Hard

Created by

Jairuz Paulo Saure

Used 5+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is an array in C#?

A collection of elements with different types.

A collection of elements with the same type.

A dynamic collection of elements.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare an array of integers in C# with a size of 10?

int[] numbers = new int();

int[10] numbers;

int[] numbers = new int[10];

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the first element in an array in C#?

0

1

-1

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop is more suitable when the number of iterations is known beforehand?

  • for loop

while loop

do-while loop

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a for loop, what does the third expression control?

Initialization

Condition

Iteration

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the element at index 3 in an array named data?

data[3]

data(3)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the foreach loop in C#?

To iterate over the elements of an array or collection.

To execute a block of code repeatedly until a condition is met.

To define a function that can be called within a loop.

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?