158k views
19 votes
Write a program that creates an array of four float elements. Use a for loop to read and store a float value at each index in the array. Then use a for-each loop to print out each element to the console.

1 Answer

2 votes

Answer:

So, for an old fashioned loop over a floatArray, you need an int for the index and a float for the value.

Step-by-step explanation:

If floatArray = [2.2, 4.4, 6.6, 8.8]

User Nicholas Morley
by
5.1k points