ELEMENTO 1

Page 38

Prueba de escritorio limi

i

a[i]

6

1

3

1

2

5

0

3

8

1

4

4

0

5

3

1

6

5

0

5

4

5

Codificaci贸n import javax.swing.JOptionPane; public class VECTOR1 { public static void main (String args[]) { String valor_limite,valor_vec; int limi,i,acu; int a[]=new int[15]; valor_limite=JOptionPane.showInputDialog("limite :"); limi=Integer.parseInt(valor_limite); for(i=1;i<=limi;i++) { valor_vec=JOptionPane.showInputDialog("Ingrese el vector :"+i); a[i]=Integer.parseInt(valor_vec); acu=acu+a[i]; } for(i=1;i<=limi;i++) if (i % 2 == 0) { JOptionPane.showMessageDialog(null,"POSICION :

LUIS H. GAMBOA B.

"+i+"

VALOR :

38


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.