Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FREEZER QUIZLINE

Total questions: 11

Worksheet time: 7mins

Name
Class
Date
1.

What does the acronym "C#" stand for?

a)

CommonSharp

b)

ComputerSharp

c)

C-Sharp

d)

CentralSharp

2.

How do you declare a constant variable in C#?

a)

const int x = 10;

b)

constant x = 10;

c)

int constant x = 10;

d)

int x = const 10;

3.

Which of the following is NOT a valid C# data type?

a)

float

b)

char

c)

decimal

d)

byte-pointer

4.

In C#, what is the purpose of the "foreach" loop?

a)

It is used for arithmetic calculations.

b)

It iterates over a collection of items.

c)

It defines a conditional block of code.

d)

It is used for exception handling.

5.

What is the default access modifier for class members in C#?

a)

public

b)

private

c)

protected

d)

internal

6.

Which keyword is used to instantiate an object in C#?

a)

new

b)

instantiate

c)

create

d)

object

7.

How do you comment a single-line in C#?

a)

// This is a comment

b)

/* This is a comment */

c)

# This is a comment

d)

-- This is a comment

8.

What is the purpose of the "try-catch" block in C#?

a)

It defines a loop.

b)

It handles exceptions and errors.

c)

It is used for conditional execution.

d)

It declares variables.

9.

What is the role of the "using" directive in C#?

a)

It includes external libraries.

b)

It creates a new instance of a class.

c)

It defines a loop.

d)

It is used for mathematical calculations.

10.

How do you declare a method in C# that does not return any value?

a)

void myMethod() { }

b)

int myMethod() { }

c)

string myMethod() { }

d)

double myMethod() { }

11.

What is the importance of C#?

4 lines