Search Header Logo

C# Fundamentals Assessment

Authored by roop lal

Computers

University

Used 2+ times

C# Fundamentals Assessment
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

-1

0

1

null

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a value type in C#?

string

bool

float

int

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to define a method in C#?

method

void

define

function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a string variable in C#?

string myString;

myString: string;

string myVariable = 'Hello';

var myString = 'Hello';

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'if' statement in C#?

The 'if' statement is used for conditional execution of code.

The 'if' statement is used to define classes.

The 'if' statement is used for looping through arrays.

The 'if' statement is used to declare variables.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

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

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

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

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

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a boolean variable in C#?

int isTrue;

boolean isTrue = true;

bool isTrue; or bool isTrue = true;

string isTrue = 'true';

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?