The following code is supposed to set i to the first occurrence of a positive number in
a[0], a[1], ... , a[n]
or to n+1 if there are no positive numbers; however, the code is incorrect. I need help with what the problem is. Also, I need to write a corrected segment.
Code:for ( i=0; a[i] <= 0 && i <= n; i++ ) ;