// computes the sum of A[0], A[1], . . ., A[N-1] // for any N >= 1 int Sum = 0; int J = 0; while (J < N) { Sum += A[J]; ++J; } // end while