CMSC 104 - Quiz 3

Total of 35 points possible - possible point totals for each question are shown as (X) below

  1. (5) Write an if-else conditional statement that tests to see if a number is even or odd?
  2. (9) What are the three ways a program can flow?

    1. ___________
    2. ___________
    3. ___________
  3. (4) When compiling what flag must you add to use the math library? i.e. "-?"
  4. (5) What is equivalent to the following expression when you apply the ! operator?
    if((a > -100) && (a < 100))
    
  5. (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;
    }