Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package unitat2algoritmes;
- public class Ejercicio4 {
- public static final int VALOR = 5;
- public static final int VALORDOS = 10;
- public static void main(String[] args) {
- if (VALOR >= VALORDOS) {
- System.out.println("El màxim és " + VALOR);
- } else if (VALORDOS < VALOR) {
- System.out.println("El màxim és " + VALORDOS);
- }
- }
- }
- public static final int VALOR = 5;
- public static final int VALORDOS = 10;
- public static void main(String[] args) {
- if (VALOR > VALORDOS) {
- System.out.println("El màxim és " + VALOR);
- } else {
- System.out.println("El màxim és " + VALORDOS);
- }
- }
- System.out.println(Math.max(VALOR, VALORDOS));
- if(VALOR==VALORDOS)
- System.out.println("Iguales");
- else
- System.out.println(Math.max(VALOR, VALORDOS));
- System.out.println((VALOR==VALORDOS)? "IGUALES" : Math.max(VALOR, VALORDOS));
- public class Ejercicio4 {
- public static final int VALOR = 5;
- public static final int VALORDOS = 10;
- public static void main(String[] args) {
- if (VALOR >= VALORDOS) {
- System.out.println("El màxim és " + VALOR);
- } else if (VALORDOS < VALOR) {
- System.out.println("El màxim és " + VALORDOS);
- }
- }
- }
- 5 >= 10 ? No se cumple, tiene un valor false.
- 10 < 5 ? No se cumple, tiene un valor false.
- if (VALOR > VALORDOS) {
- System.out.println("El màxim és " + VALOR);
- } else if (VALOR < VALORDOS){
- System.out.println("El màxim és " + VALORDOS);
- }
- if (VALOR == VALORDOS) {
- System.out.println("Los valores son iguales!");
- } else ...
- ...
Add Comment
Please, Sign In to add comment