Opinen sobre este codigo
Publicado por Luis (2 intervenciones) el 25/04/2018 15:28:06
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Import java.util.Scanner;
class PruebaArray
{
public static void main(String args[])
{
Mostrar(Entrada());
}
public static int[] Entrada()
{
int array[] = new int[10];
Scanner into = new Scanner(System.in);
int cont = 0, num;
do
{
System.out.print("Ingrese numero: ");
num = into.nextInt();
array[cont] = num;
cont++;
}while(cont < 10);
return array;
}
public static void Mostrar(int array[])
{
System.out.println();
System.out.println("Los Valores Ingresados Fueron");
System.out.println();
for(int i=0; i < array.length; i++)
{
System.out.println("Indice " + i + " valor " + array[i]);
}
}
}
Valora esta pregunta


1