C# Programming Essentials

C# Programming Essentials

Professional Development

15 Qs

quiz-placeholder

Similar activities

CSS basics

CSS basics

Professional Development

15 Qs

MCES_Fundamentals_Q2

MCES_Fundamentals_Q2

Professional Development

15 Qs

CPR _Chapter2 _Onlinequiz

CPR _Chapter2 _Onlinequiz

Professional Development

15 Qs

Mastering C# Conditional Statements

Mastering C# Conditional Statements

Professional Development

15 Qs

DAY1

DAY1

Professional Development

15 Qs

Unit 2 - Taking abap to sap hana

Unit 2 - Taking abap to sap hana

Professional Development

10 Qs

Use of Mirrors Activate Prior Knowledge Activity

Use of Mirrors Activate Prior Knowledge Activity

Professional Development

10 Qs

Flutter Online Quiz

Flutter Online Quiz

Professional Development

18 Qs

C# Programming Essentials

C# Programming Essentials

Assessment

Quiz

Professional Development

Professional Development

Medium

Created by

Rodrigo Calapan

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default value of an int in C#?

-1

1

null

0

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which data type is used to store a single character in C#?

string

float

int

char

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to define a conditional statement in C#?

else

when

if

switch

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write an if statement in C#?

if (condition) { // code to execute }

if condition { // code to execute }

if (condition) // code to execute

if { condition } // code to execute

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the else clause in an if-else statement?

To create a loop that repeats the if condition.

To execute a block of code when the if condition is true.

To execute a block of code when the if condition is false.

To define a function that runs before the if statement.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Can you nest if statements in C#? Give an example.

if (condition1) { if (condition2) { // Code to execute if condition1 is false } }

Example: if (condition1) { if (condition2) { // Code to execute if both condition1 and condition2 are true } }

if (condition1) { // Code to execute }

if (condition1 && condition2) { // Code to execute if either condition is true }

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for a switch statement in C#?

switch (variable) { case value1: // code block; break; case value2: // code block; break; default: // code block; }

switch: variable { case value1: // code block; }

switch (variable) case value1: // code block; break;

switch variable { case value1: // code block; }

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?