wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C# Variables and Data Types

Total questions: 9

Worksheet time: 3mins

Name
Class
Date
1.
Which best describes a variable?
a)
Variables store program data while code runs
b)
Variables control memory space
c)
Variables are individual values in a database table
d)
Variables enable programmers to work with different input devices
2.
Which of the following is false?
a)
Variable values can change while a program runs
b)
Variables make it possible to process almost any kind of data
c)
All variables use the same amount of memory
d)
Variables must be stored in a database or file if they are to be retained when the program ends
3.
To use the value of a variable you need to know:
a)
The size of the memory used by its data type
b)
The source of the data being stored
c)
The physical address location in memory
d)
A name to reference the data 
4.
Which of the following data types cannot store the number 47,255?
a)
decimal
b)
int
c)
string
d)
byte
5.
In C# the syntax to declare a variable is:
  datatype variablename;
Which of the following
C# declarations are invalid?
a)
byte userage;
b)
integer intScore; 
c)
string STR_NAME; 
d)
decimal DeCtuRn;
6.
Which holds integers or real numbers with 28 digit precision? (128 bits)
a)
int
b)
decimal
c)
bool
d)
string
7.
Which holds alphanumerics using a Unicode encoding? (size varies)
a)
bool
b)
int
c)
decimal
d)
string
8.
Which holds whole numbers? (32 bits)
a)
string
b)
bool
c)
int
d)
decimal
9.
Which holds true or false?
 (8 bits)
a)
bool
b)
int
c)
decimal
d)
string