Respuesta :
Answer:
what language?
Explanation:
In Java:
import java.lang.reflect.Array;
public class Main {
public static void main(String[] args) {
int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
for (int i = 0; i < Array.getLength(arr); i++) {
System.out.println(arr[i]);
}
}
}
------------------------------------------------------------------------
Notice, the program is printing the value equivalent to the index at given moment, so if you array is made of String or other type that's not int, it will work the same.
Following are codes to the given question:
Code Explanation:
- In this code, a for loop is declared that uses an integer "i" variable that holds array value and inside the loop, a print method is used.
- In this print method, it's the all array element value.
Code:
for (int i = 0; i < length; i++)//defining a for loop that holds array value and use print method that prints array value
cout<<names[i]<<endl;//print array value
- Please find the program in the attached file.
Learn more:
brainly.com/question/15207448
![Ver imagen codiepienagoya](https://us-static.z-dn.net/files/d72/fd671c806dde628e474f98bbe6e2fb6b.jpg)