Font size
WorksheetsUnity C# Basics, Variables and Operators
Total questions: 18
Worksheet time: 10mins
What is the output of this code?
int x = 8;
// x = 3;
Console.WriteLine(x);
3
8
error
24
What is the output of this code?
int x = 16;
int y = 5;
Console.WriteLine(x/y);
3.2
3
error
4
What does <= mean?
less than
greater than
less than or equal to
greater than or equal to
What punctuation is used to signal the beginning and end of code blocks?
{ }
-> and <-
BEGIN and END
( and )
After running the following code, what will be the value of x?
int y = 3;
x = 5 * y;
Compiler Error
___ variables store whole numbers (-4, 3, 51, etc).
float
logical
char
int
double
___ variables store decimal numbers (3.5, -5,123, 4.0, etc).
float
int
string
character
double
Which of the following is NOT a logical operator in C# language?
&
&&
||
!
Which of the following is NOT a comparison operator in C# language?
>
<=
=
==
A Unity script is also a ___.
Monobehavior Component
Game Object
Material
Window in Workspace
Function
We use the ___ programming language in Unity.
C++
C#
Java
Objective C
PHP
Access modifier which will allow a property value to be edited via the inspector
public
private
protected
static
const
The information about an objects position, rotation and scale are stored in its (a) component.
In a Unity game, number values containing decimals are usually stored using a variable of type (a) .
The (a) () function of a script will run before the first frame update.
The (a) () function of a script will run once for each frame of the game.
Replace the (a) with false.
What will be displayed?
What should replace the blank to display the message when it should.
Use the variable x in your answer and remove any spaces.
(a)
