Assessment
Assessment
Console.WriteLine("Hello Samuel")?
A. Hello World
B. Hello Samuel
C. Samuel
D. Error
A. Declares a variable
B. Initializes a variable
D. Prints a number
3. How do you correctly declare and initialize a character variable with the letter 'A' in
C#?
B. char alphabet = A;
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
A. True
B. False
C. 7
D. 9
5. Which of the following is the correct way to use string interpolation in C# to display
D. Console.WriteLine($name);
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
Page 2
C# Beginner Quiz - Dekox Tech Academy
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
A. /
B. *
C. %
D. +
9. What is the purpose of the code block that reads a character from the user and prints
Page 3
C# Beginner Quiz - Dekox Tech Academy
B. Compares characters
10. In a conditional block where the number is checked to be greater than 10, what
D. It will do nothing
Page 4