Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Lunes
Lunes
nextInt();
int mayor = num;
boolean hayNegativos = false;
if (num<0) hayNegativos = true;
while (num¡=0)
-------------------------------------------------------------------
BUCLE: (ejercicio 8 del tema 3)
int num;
do {num = sc.nextInt(); } while (num==0);
------------------------------------------------------------------
EJERCICIO 5 DEL TEMA 2
import java.util.Scanner;
if (x==y)
{ System.out.println("Son iguales");
} else {
System.out.println("No son iguales");
}
sc.close();
}
}
------------------------------------------------------------------
ARRAYS:
//EJERCICIO 1 DEL TEMA 4
*/
import java.util.Scanner;
int numeroMayorCont = 0;
int numeroMenorCont = 0;
for (int i=0; i<10; i++)
{
if (notas[i] == numeroMayor) numeroMayorCont++;
if (notas[i] == numeroMenor) numeroMenorCont++;
}
sc.close();
}
}
------------------------------------------------------------------