Font size
WorksheetsProgramming Fundamentals Quiz
Total questions: 28
Worksheet time: 14mins
What is the purpose of the Console.WriteLine() method?
Reads only one single character from the standard input stream
Reads a single line from the standard input stream
Writes a specified string value to the standard output stream
Returns an integer after reading a single character
Which data type is used to store characters in C#?
float
char
int
double
What is the result of 20 % 4 in C#?
0
2
1
4
Which operator is used for multiplication in C#?
/
-
*
+
If 1 + 1 = 2, and 2 + 2 = 4, what is 3 + 3
6
Fish
A question for a mathematician, not me
What is the purpose of the boolean data type in C#?
To store characters
To evaluate conditions as true or false
To perform arithmetic operations
To store floating-point numbers
Which operator is used to calculate the remainder of a division operation in C#?
/
*
%
+
What is the correct way to assign a value to a variable x after adding 1 to its current value?
x -= 1;
x = x - 1;
x += 1;
x = x + 1;
Which type of comment in C# starts with /* and ends with */?
Single-Line comment
Multi-Line comment
Documentation comment
No comment
What is the purpose of the Console.Read() method in C#?
Reads a single line from the standard input stream
Reads only one single character from the standard input stream
Returns an integer after reading a single character
Writes a specified string value to the standard output stream
Which data type is used to store floating-point numbers with higher precision in C#?
char
double
float
int
What is the purpose of the Console.ReadLine() method in C#?
Reads a single line from the standard input stream
Reads only one single character from the standard input stream
Returns an integer after reading a single character
Writes a specified string value to the standard output stream
Which data type is used to store integers in C#?
float
char
int
double
What is the purpose of the Console.ReadKey() method in C#?
Reads a single line from the standard input stream
Reads only one single character from the standard input stream
Returns an integer after reading a single character
Writes a specified string value to the standard output stream
What is the correct way to declare a variable of type double in C#?
double x = 10.5;
int x = 10.5;
float x = 10.5;
char x = 10.5;
Which keyword is used to define a constant value in C#?
var
final
const
static
What is the best car brand?
BMW
Toyota
Audi
Mazda
Mercedes
What is the purpose of the 'break' statement in a switch-case block in C#?
To exit the loop and continue with the next iteration
To skip the current iteration and move to the next one
To exit the switch-case block and continue with the code after it
To restart the loop from the beginning
What is the purpose of the 'continue' statement in a loop in C#?
To exit the loop and continue with the next iteration
To skip the current iteration and move to the next one
To exit the loop and terminate the loop execution
To restart the loop from the beginning
What do you call a programmer who can't solve a bug?
A debug-free zone
A code-breaker
A bug-eyed coder
What is the purpose of the 'ToString()' method in C#?
To convert an object to a string representation
To convert a string to an object
To compare two objects for equality
To perform mathematical operations
What is the correct syntax for a for loop in C#?
for (int i = 0; i < 10; i++)
for (int i = 0; i++)
for (i = 0; i < 10; i++)
for (i = 0; i++)
Which statement is used to terminate the current iteration in a loop in C#?
break;
continue;
return;
exit;
What is the purpose of the 'break' statement in a loop in C#?
To skip the current iteration and move to the next one
To exit the loop completely
To restart the loop from the beginning
To print a message to the console
Which data type is used to store a single character in C#?
char
string
int
bool
What is the purpose of the 'Console.Clear()' method in C#?
Clears the console screen
Writes a specified string value to the standard output stream
Reads a single line from the standard input stream
Reads only one single character from the standard input stream
What do you call a lazy kangaroo?
A pouch potato
A sleepy joe
A kangaroo with a Monday morning attitude
What do you call a cheese that isn't yours?
Nacho cheese
Stolen brie
A dairy dilemma
