CMSC 104 - Quiz 3
Total of 35 points possible - possible point totals for each question are shown as (X) below
- (5) Write an if-else conditional statement that tests to see if a number is even or odd?
-
(9) What are the three ways a program can flow?
- ___________
- ___________
- ___________
- (4) When compiling what flag must you add to use the math library?
i.e. "-?" - (5) What is equivalent to the following expression when you apply the ! operator?
if((a > -100) && (a < 100))
- (12) What is the output of the following code:
#include <stdio.h>
int main(void)
{
int x = 9;
switch(x){
case 9: case 10:
printf("Hi there 9 & 10\n");
case 12:
printf("Hi there 12\n");
break;
default:
printf("Hi there other value\n");
}
return 0;
}
- (12) What is the output of the following code: