Font size
Worksheets2.2.1 (d) Variables
Total questions: 10
Worksheet time: 10mins
In C#, which data type stores whole numbers from -2,147,483,648 to 2,147,483,647?
int
long
float
double
In C#, which data type stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807?
int
long
float
double
In C#, which data type stores fractional numbers with 6 to 7 decimal digits?
int
long
float
double
In C#, which data type stores fractional numbers with 15 decimal digits?
int
long
float
double
Which data type stores true or false values?
int
long
bool
char
Match the following C# Datatype Declarations
int myNum
5;
double myDoubleNum
5.99
char myLetter
'D'
bool myBool
true
string myText
"Hello"
==
!=
<
<=
>
>=
+
-
/
*
MOD
DIV
^
AND
OR
NOT
The (a) keyword is useful when you want a variable to always store the same value, so that others (or yourself) won't mess up your code. An example that is often referred to as a constant, is (b) (3.14159...).
Note: You cannot declare a (c) variable without assigning the value. If you do, an (d) will occur: A const field requires a (e) to be provided.
Names are case-sensitive ("myVar" and "myvar" are different variables).
True
False
int x = 5, y = 6, z = 50;
Console.WriteLine(x + y + z);
This code snippet will output what integer value?
(a)
