C# MasterClass
Home
Lessons
Examples
Quiz
Quiz 1: Output & Syntax
1. Which command prints text to a new line?
Console.Write()
Console.WriteLine()
print()
2. Every C# statement must end with:
: (Colon)
; (Semicolon)
. (Dot)
3. C# is case-sensitive (Main is different from main).
True
False
Submit Answers
Quiz 2: Input Data
1. Console.ReadLine() returns which data type?
String
Integer
Boolean
2. To convert a String "5" to an Integer, use:
int("5")
Convert.ToInt32("5")
Parse.String("5")
3. What happens if you try to do math on a string?
It works fine
Error (Must convert first)
It deletes the data
Submit Answers
Quiz 3: Operators
1. What is the result of
10 % 3
?
1
3
0
2. Which operator calculates multiplication?
x
*
#
3.
x++
increases the value of x by:
1
2
10
Submit Answers
Quiz 4: Conditions
1. Which keyword catches anything not caught by 'if'?
then
else
stop
2. Which operator means "Equal to"?
=
==
!=
3. Logical operator for OR is:
&&
||
!!
Submit Answers
Quiz 5: Loops
1. Which loop is best when iteration count is known?
for
while
if
2. Which loop runs as long as a condition is true?
for
while
switch
3. An infinite loop is a loop that never stops.
True
False
Submit Answers
Quiz 6: Arrays
1. Array indexes start with:
0
1
-1
2. How to access the first element of array 'cars'?
cars(0)
cars[0]
cars{1}
3. Which property finds the size of an array?
.Size
.Count
.Length
Submit Answers
Quiz 7: Switch Statement
1. Which keyword stops the execution inside a case?
break
stop
return
2. Which keyword runs if no match is found?
else
default
other
3. Switch statements are often cleaner than many if-else blocks.
True
False
Submit Answers
Quiz 8: Methods
1. A method that returns no value uses which keyword?
null
void
empty
2. Variables passed into a method are called:
Parameters
Loops
Classes
3. Which keyword is used to send a value back?
send
return
back
Submit Answers