0% found this document useful (0 votes)
4 views4 pages

Assessment

The document is a C# beginner quiz from Dekox Tech Academy consisting of 10 questions that test fundamental programming concepts in C#. Each question includes multiple-choice answers and prompts for explanations, covering topics such as variable declaration, data types, string interpolation, and error handling. The quiz is designed to assess the understanding of basic C# syntax and operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Assessment

The document is a C# beginner quiz from Dekox Tech Academy consisting of 10 questions that test fundamental programming concepts in C#. Each question includes multiple-choice answers and prompts for explanations, covering topics such as variable declaration, data types, string interpolation, and error handling. The quiz is designed to assess the understanding of basic C# syntax and operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

C# Beginner Quiz - Dekox Tech Academy

1. What will be displayed when the program executes the statement:

Console.WriteLine("Hello Samuel")?

A. Hello World

B. Hello Samuel

C. Samuel

D. Error

Explain your answer:

2. What is the meaning of the statement: int number = 23; in C#?

A. Declares a variable

B. Initializes a variable

C. Declares and initializes a variable

D. Prints a number

Explain your answer:

3. How do you correctly declare and initialize a character variable with the letter 'A' in
C#?

A. char alphabet = "A";

B. char alphabet = A;

C. char alphabet = 'A';

D. char alphabet = 'ABC';

Explain your answer:

Page 1
C# Beginner Quiz - Dekox Tech Academy

4. If the values of a and b are 7 and 9 respectively, what will be the result of

evaluating the expression a < b?

A. True

B. False

C. 7

D. 9

Explain your answer:

5. Which of the following is the correct way to use string interpolation in C# to display

the value of a variable named 'name'?

A. Console.WriteLine("My name is " + name);

B. Console.WriteLine("My name is {name}");

C. Console.WriteLine($"My name is {name}");

D. Console.WriteLine($name);

Explain your answer:

6. What will happen if a user inputs a word instead of a number in the line: int

number = Convert.ToInt32(Console.ReadLine());?

A. It will convert it to 0

B. It will throw a compile-time error

Page 2
C# Beginner Quiz - Dekox Tech Academy

C. It will throw a run-time error

D. It will ignore the input

Explain your answer:

7. Which data type should be used for storing Boolean values such as true or false in
C#?

A. int

B. string

C. char

D. bool

Explain your answer:

8. In C#, which symbol is used to represent the modulus operator?

A. /

B. *

C. %

D. +

Explain your answer:

9. What is the purpose of the code block that reads a character from the user and prints

it back to the screen?

Page 3
C# Beginner Quiz - Dekox Tech Academy

A. Adds two characters

B. Compares characters

C. Takes character input from the user and prints it

D. Declares a boolean value

Explain your answer:

10. In a conditional block where the number is checked to be greater than 10, what

message is displayed if the user enters a number less than 10?

A. It will print the first message

B. It will throw an error

C. It will print the second message

D. It will do nothing

Explain your answer:

Page 4

You might also like