Solutions to q5 from Midterm Exam E02 practice Exam


a) 40

b) is undefined (because a[5] is outside the array)

c) 0 (When the array initializer is shorter than the array, all remaining elements are assigned to 0.)

 

d) 3

See also: q5.c

Sample output:

-bash-3.2$ ./q5
40
-1075556408
0
3
-bash-3.2$