Created
June 14, 2012 21:31
-
-
Save godie007/2933076 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.JOptionPane; | |
public class paradigma { | |
public static void main(String[] args) { | |
suma(); | |
} | |
public static int[] ingresados() { | |
int arreglo[] = new int[10]; | |
for (int i = 0; i < 10; i++) { | |
arreglo[i] = Integer.parseInt(JOptionPane.showInputDialog("ingredas")); | |
} | |
return arreglo; | |
} | |
public static void suma() { | |
int suma = 0; | |
for (int i = 0; i < ingresados().length; i++) { | |
suma += ingresados()[i]; | |
} | |
System.out.println(suma); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment