NEW
Font size
S
M
L
XL
WorksheetsEB
Total questions: 49
Worksheet time: 25mins
Name
Class
Date
1.
What does '-Wall' do when compiling?
a)
Calls WALL-E
b)
Shows all warnings
c)
Allows warnings to be bypassed
d)
Connects to the Program
2.
Which of the following is not a type of data?
a)
volatile
b)
enum Bool{true, false}
c)
string
d)
float
3.
Which of the following is NOT part of the key words that cannot be used in variable name allocation?
a)
goto
b)
double
c)
inline
d)
triple
4.
Is this correct? void main (int)
a)
Yes
b)
No
5.
What is the meaning of the X in the following: %m.pX
a)
Precision
b)
Conversion Specifier
c)
Width
d)
Location
6.
What does /a do?
a)
Sets an alarm
b)
Punctuation
c)
Backslash
d)
And Symbol
7.
Why does scanf use an & symbol?
a)
Stores the variable as the name
b)
Stores the variable in the memory location that ends the string
c)
Stores the variable in the memory location that starts the string
d)
Looks fancy
8.
Which are unary arithmetic operators?
a)
+, -
b)
+, -, *, /
c)
%
d)
()
9.
What does a binary operand require?
a)
One variable
b)
Two variables
10.
Does the prefix or postfix arithmetic matter?
a)
Yes
b)
No
11.
Which of the following is not a type of loop?
a)
if/else
b)
case
c)
do...while
d)
switch
12.
What is required of each case in a switch statement?
a)
continue
b)
statements
c)
else
d)
break
13.
In a switch statement, defualt is most like?
a)
elseif
b)
else
c)
do
14.
Do while loops ensures?
a)
One loop is completed
b)
The condition is checked first
15.
Which of the following is an incorrect infinite loop?
a)
while(1)
b)
for(;;;)
c)
for(1,1,1)
d)
do...while(1)
16.
What does %le stand for? (printf())
a)
long exponential
b)
double exponential
c)
long scientific
d)
double scientific
17.
What does %Lg mean? (printf())
a)
long double auto
b)
long auto
c)
double auto
d)
Length auto
18.
What does a char store? (Most correct)
a)
A letter
b)
A variable
c)
An ASCII code
d)
A novel
19.
Why is it good practice to write scanf with a white space?
a)
Looks good
b)
Allows for a new line buffer
c)
It's bad practive
d)
Doesn't do anything
20.
Which of the following is correct format for typecasting?
a)
(float) i
b)
int i
c)
char *t
d)
typecast(int) i
21.
What is the data type of the return value in the following prototype?
char function(int k, double b);
char function(int k, double b);
a)
int
b)
char
c)
double
22.
What is the problem with function prototyping?
a)
Only one input
b)
There is none
c)
Only one return
d)
Everything
23.
Which of the following is not a way of returning from a function?
a)
exit()
b)
return()
c)
Both are valid
d)
Both are invalid
24.
What library is the exit protocols of EXIT_FAILURE and EXIT_SUCCESS are in?
a)
stdio.h
b)
math.h
c)
exit.h
d)
stdlib.h
25.
Are recursive functions valid?
a)
Yes
b)
No
26.
Can array size be left undetermined?
a)
Yes
b)
No
c)
Only when they are more than one dimension
d)
Yes when they are only one dimension
27.
Array indexing starts at...
a)
1
b)
0
c)
10
d)
-1
28.
What is the last character in the string "Cat"?
a)
t
b)
\0
c)
/0
d)
/end
29.
What is the difference between puts and printf?
a)
Puts automatically places a newline at the end
b)
Printf is safer
30.
What is the danger with gets?
a)
Person doesn't press enter
b)
Corruption
c)
It's harder to read
31.
With the strcmp function, what number will be returned is the first string is larger than the second?
a)
>0
b)
<0
c)
0
32.
What is a pointer?
a)
A variable
b)
A variable that contains the address of another variable
c)
A sharp stick
d)
A pointeee
33.
Which of the following is of the meaning the *?
a)
Declare a pointer
b)
Multiplication
c)
The variable at the pointee
d)
Note
34.
Which of the following is a generic pointer?
a)
*p = NULL;
b)
void *p;
c)
*p = 0x54236424;
d)
*p =?;
35.
What is a pixel?
a)
An LED
b)
The smallest drawing element
c)
Pixie
d)
Computer Term
36.
Which of the following is not an advantage of the floating point coordinate system (openGL)?
a)
Easy
b)
Easily scaled
c)
Generic
37.
What is the oringial purpose of GLUT?
a)
To create the window
b)
To have more functions
c)
Beta testing
d)
For Fun
38.
How do you fix screen tearing?
a)
Buffer
b)
Double Buffer
c)
Hope for the best
d)
Timer
39.
What is the difference between using struct and typedef struct?
a)
typedef creates a sub data type
b)
Nothing
c)
typedef is just the long way of writing it
d)
Struct is more stable
40.
In a union which of the following variables wouldn't be corrupted?
num.x = 100; printf("%d\t%f\t%c\n", num.x, num.y, num.c);
num.x = 100; printf("%d\t%f\t%c\n", num.x, num.y, num.c);
a)
x
b)
y
c)
c
d)
None are
41.
What is the first variable allocated when using enumeration?
a)
1
b)
-1
c)
0
d)
What??
42.
Which of the following is not an example of a special pre-processor?
a)
#pragma
b)
#parma
c)
#line
d)
#error
43.
What does _DATE_ do?
a)
Prints the date
b)
Prints the time
c)
Prints the data the program complied
d)
Prints the year
44.
What <EOF> mean?
a)
End of Face
b)
End of France
c)
End of File
d)
End of Failure
45.
Which of the following is not a type of stream?
a)
stdin
b)
stderr
c)
stdout
d)
stdio
46.
What does this do?
program < data.dat
program < data.dat
a)
program is less than data.dat
b)
Redirects the output stream to data.dat
c)
Redirects the stream to program
d)
Redirects the input stream to data.dat
47.
Binary files can be read by a text editor?
a)
Yes
b)
No
48.
In the code: int fseek(FILE *stream, long offset, int whence);
Whence can not be?
Whence can not be?
a)
SEEK_END
b)
SEEK_NOW
c)
SEEK_CUR
d)
SEEK_SET
49.
What does rewind do?
a)
takes you back to the beginning of the file
b)
undo
c)
redoes the code
d)
Mmm....
Reset
