## Short Answers, 4 points each

This section cannot be graded on-line. To practice taking the exam, jot down your answer and click on the button after each question to see a sample solution.

There are no intentional syntax errors in this section. Answers like ``There is no output, because there is a syntax error'' will receive 0 credit.

1. What is the output of the following code?
```    int i, j ;

for (i = 0 ; i < 5 ; i++) {
for (j = 0 ; j < 5 ; j++) {
if ( i * i >= j) {
printf("X") ;
} else {
printf("O") ;
}
}
printf("\n") ;
}
```

2. Write down the output of this program. Show your work and clearly indicate your final answer.
```    #include <stdio.h>
#include "genlib.h"
#include "simpio.h"

int foobar(int a) ;
int geez(int b) ;

main() {
int a = 1, b = 2, c = 3 ;

c = geez(a) ;
b = foobar(c) ;
printf("main: a = %d, b = %d, c= %d\n", a, b , c) ;
}

int foobar (int b) {
int a, c ;

a = geez(b) ;
c = b++ ;
printf("foobar: a = %d, b = %d, c = %d\n", a, b, c) ;
return(c) ;
}

int geez (int c) {
int a, b ;

a = c + 100 ;
b = 2 * a ;
printf("geez: a = %d, b = %d, c = %d\n", a, b, c) ;
return(a) ;
}
```

3. Write a simple loop to print out the following numbers. (Hint: this is the first part of the sequence of the squares of odd numbers.)
```      1 9 25 49 81 121 169
```