Más contenido relacionado
La actualidad más candente (20)
Similar a Programa 24 (20)
Programa 24
- 3. Código
package arreglos;
import javax.swing.JOptionPane;
public class Ejercicio2 {
public static void ArreglosBidimensionales() { int n,m;
n=Integer.parseInt(JOptionPane.showInputDialog(null, "ESCRIBE LAS FILAS DEL ARREGLO"));
m=Integer.parseInt(JOptionPane.showInputDialog(null, "ESCRIBE LAS COLUMNAS DEL ARREGLO"));
int Arreglo[][]=new int [n][m];
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
Arreglo[i][j]=Integer.parseInt(JOptionPane.showInputDialog(null,"INGRESE ELVALOR "+"DEL ELEMENTO
ARREGLO["+i+"]"+"["+j+"]"));
}}
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
Object msj="ARREGLO [" + i + "]"+"[" + i + "]"+Arreglo[i][j];
JOptionPane.showInputDialog(null, msj, "SALIDA", JOptionPane.PLAIN_MESSAGE);
System.out.println("ARREGLO[" + i + "]" + j + "[" + "]="+Arreglo[i][j]);}}}
public static void main(String[] args) {
ArreglosBidimensionales();}}