Section 0101, 0102, 0103 & Honors, Fall 1995
Quiz 1
True or False Questions, 1 point each
To practice taking this section. Select TRUE or FALSE in the pop-up menus
after each question to record your answer. To submit your answers for
grading, click on the "submit for grading" button.
On lynx, use down arrow to move to the next question or choice.
Hit return to make your selection.
Multiple Choice, 2 points each
To practice taking this section. Choose the best answer in the pop-up
menu after each question to record your answer. To submit your answers
for grading, click on the "submit for grading" button.
On lynx, use down arrow to move to the next question or choice.
Hit return to make your selection.
Short Answers, 4 points each
This section cannot be graded on-line. To practice
taking the exam, jot down your answer and follow the link
after each question to see a sample solution.
- Write down the output of the following program fragment.
int n ;
n = 3 ;
if (n != 3) {
printf("Captain Fantastic\n") ;
} else if (n * 2 <= 5 + n) {
printf("Brown Dirt Cowboy\n") ;
} else {
printf("Rocket Man\n") ;
}
Sample Solution
- What is the output of the following code fragment?
int i;
for (i = 0 ; i < 9 ; i = i + 2) {
printf("%d\n", 2 * i) ;
}
Sample Solution
- What is the output of the following code fragment?
int n, m ;
n = 1 ;
m = 1 ;
while (n < 30) {
printf ("n = %d, m = %d\n", n, m) ;
m = m + 2 ;
n = n + m ;
}
Sample Solution
Last Modified:
Tue Oct 3 09:56:17 EDT 1995
Richard Chang, chang@gl.umbc.edu