Eli Skoglund: CPSC 1011-04
9/28/2022
Lab 5


Using an editor, answer the following questions:

NAME: Eli Skoglund

---------
example.c
---------
1) What is the cause of the seg fault in the program called example.c?

	The part of the condition that says i >= 0 makes the loop repeat indefinitely because i is always going to be greater than or equal to zero.

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

3) What was the value of the variable "count" at the time of the seg fault?
	
	10
4) What was the value of the variable "i" at the time of the seg fault?

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

	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?
	assigning a value to to the variable search using the "=" operator instead of using a logical equals "==" to check if a condition about the variable search is true. 

