C# Programming Essentials

C# Programming Essentials

Professional Development

15 Qs

quiz-placeholder

Similar activities

Payment and Payment Arrangement

Payment and Payment Arrangement

Professional Development

17 Qs

MTS WA380z-6

MTS WA380z-6

Professional Development

10 Qs

Python if statement

Python if statement

Professional Development

10 Qs

PJP Apr 23

PJP Apr 23

Professional Development

10 Qs

Q1 Introduction to Python

Q1 Introduction to Python

Professional Development

15 Qs

SvensQA -ISTQB- QUIZ1

SvensQA -ISTQB- QUIZ1

Professional Development

10 Qs

operators & loops

operators & loops

Professional Development

20 Qs

Switching & Routing System (SRS)

Switching & Routing System (SRS)

Professional Development

20 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?