// FirstPositive(A, n) returns the first positive // number in array A[0,...,n-1]. If none of those // numbers are positive, firstPositive returns 0. int firstPositive(int A[], int n) { for(int i = 0; i < n; i++) { if(A[i] > 0) { return A[i]; } } return 0; }