The user is expected to input an array of integers (possibly negative) and your program determines whether there exists a subarray (which is a nonempty subset of the array consisting of consecutive elements) whose elements sum to zero. Output "yes" or "no" followed by '\n'. The input format is the same as Lab 6-2. You can assume the maximum length of the input array is 20. In the given example, the input is {4, 2, -3, 1, 6}, which contains a subarray {2, -3, 1} whose elements sum to 0.
5
4 2 -3 1 6
yes