Pre-lab questions
Name:
Cnet ID:
Lab start time:
Note: There may be more than one answer.
Print this out and fill it out before lab.
Bring it to lab - this is how you get participation
for attending lab. It must be turned in by 5 minutes
after lab starts to get credit.
_____1. The C compiler takes what as input?
a) a flow-chart with the program design
b) instructions written for a human
c) code written in a programming language
d) code written in binary
_____2. What does the C compiler produce as output?
a) a web page
b) an executable
c) optimized code written in a programming language
d) an iPad app
_____3. What function prints to the screen in functions.c?
a) printf
b) print
c) cout
d) putc
_____4. What syntax do you use for a single-line comment?
a) /* ... */
b) //
c) $
d) #
_____5. What syntax do you use use for a multi-line comment?
a) /* ... */
b) //
c) $
d) #
_____6. What do you put at the top of every .c file?
a) #include <stdio.h>
#include <stdlib.h>
b) #define FILENAME_C
c) #ifndef FILENAME_C
d) #undef FILENAME_C
_____7. Where does every C program start?
a) in the first function in the file named main.c
b) in the last function in the file named main.c
c) in the first function in the first file of the compile line
d) in the function named main
_____8. What is the return type of the return_a_value function?
a) int
b) unsigned int
c) char
d) float
_____9. What line of code in main calls fact on the number 5?
a) unsigned long int result = fact(input);
b) fact(5);
c) num_correct += check_factorial(5, 120);
d) return_a_value(3);