Rewrite the following loops without using the for each


Rewrite the following loops without using the "for each" (enhanced for loop) construct. Here, values have the type double.

(a) for (double element : values) sum = sum + element;
(b) for (double element : values) if (element == target) return true;

Solution Preview :

Prepared by a verified Expert
Business Management: Rewrite the following loops without using the for each
Reference No:- TGS02138933

Now Priced at $10 (50% Discount)

Recommended (91%)

Rated (4.3/5)