Search Header Logo

C# Control Structures Quiz

Authored by Rhayz Bautista

Computers

12th Grade

Used 1+ times

C# Control Structures 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 • 2 pts

What does the 'if' statement do in C#?

Declares an array

Specifies a block of code to be executed if a condition is false

Specifies a block of code to be executed if a condition is true

Loops through a block of code

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to check if two values are equal in C#?

>

!=

==

<=

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'else' statement?

To specify a block of code if the condition is true

To specify a block of code if the condition is false

To loop through elements

To declare an array

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the 'switch' statement do?

Selects one of many code blocks to be executed

Checks for equality

Loops through a block of code

Declares a variable

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when the 'break' keyword is encountered in a switch statement?

It continues to the next case

It exits the switch block

It loops back to the start

It executes the default case

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop executes at least once before checking the condition?

for loop

foreach loop

while loop

do/while loop

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'continue' statement in a loop?

To exit the loop

To skip the current iteration and continue with the next

To declare an array

To check a condition

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?