Documentos de Académico
Documentos de Profesional
Documentos de Cultura
1. NUMEROS PRIMOS
package ejercicio1_funciones;
import java.util.Scanner;
if (numero <= 1) {
return false;
if (numero % i == 0) {
return false;
return true;
if (esPrimo(numero)) {
} else {
}
2. MINIMO COMUN DIVISOR
package ejercicio2_funciones;
import java.util.Scanner;
System.out.println("El MCD de " + num1 + " y " + num2 + " es: " + mcd);
if (b == 0) {
return a;
} else {
}
3. MAYOR A MENOR
package ejercicio3_funciones;
import java.util.Scanner;
arreglo[i] = scanner.nextInt();
ordenarArreglo(arreglo);
arreglo[j] = arreglo[j+1];
arreglo[j+1] = temp;