CP SC 1011: Lab 5, Fall 2022

Using an editor, answer the following questions:

NAME: Davis Katz

---------
example.c
---------
1) What is the cause of the seg fault in the program called example.c?
An inproper while loop caused the seg fault


--------
broken.c
--------
2) What line in broken.c did the program seg fault on?
Line 34

3) What was the value of the variable "count" at the time of the seg fault?
count = 9

4) What was the value of the variable "i" at the time of the seg fault?
i = 0

5) What was the value of the variable "search" at the time of the seg fault?
search = 1

6) What are the values in the "table" array?

table[0]: 5
table[1]: 10
table[2]: 12
table[3]: 14
table[4]: 16
table[5]: 18
table[6]: 20
table[7]: 22
table[8]: 24
table[9]: 26

7) what do you think the bug is?
the while loop couldnt run properly due to inproper if/else statements that resulted in a segment error

