The largest of three numbers


martes, 31 de octubre de 2023 ⁃ Dificultad: Fácil

Objetivo

Write a Java program that prompts the user to enter three numbers (x, y, z) and determines which of them is the largest number. Then, display that number on the screen.

Entrada

6
12
19

Salida

19

Solución

Haz clic aquí para ver la solución del ejercicio

Compártelo

Compártelo en tus redes sociales y desafía a tus amigos a resolver problemas de programación. Juntos, podemos aprender y crecer.

Copiado

El codigo se ha copiado correctamente en el portapapeles.

Más Ejercicios

Continua mejorando tus habilidades de programación en Java con nuestra selección de ejercicios prácticos de la lección. ¡Haz clic en Practicar y desafía tus conocimientos!

1

Basic calculator using if

Java basic calculator. Input numbers and operators (+, -, x, /) for calculation. If the symbol is not valid, it displays 'Character not recognized'.

2

ABS - Absolute value

Calculate and display the absolute value of a number in Java with this programming exercise on conditions.

3

Basic calculator using switch

Basic calculator with switch for mathematical operations. Allows decimal numbers and error handling. Practice your skills in Java.

4

Positive and negative

Learn Java: Detect whether a number is positive or negative in this programming exercise. Enhance your Java skills.

5

Check vowels with switch

Create a Java program that prompts the user for a letter (x) and checks whether it is a vowel or any other symbol.

6

boolean and conditional operator

Create a Java program that uses the conditional operator to assign value to a boolean variable.

7

The largest of three numbers

Java exercise to find the largest number among three and practice Java conditions.

8

Conditional operator

9

Nested conditional operator

Create a Java program that prompts the user to enter two integers (a, b) and determines how many of them are positive using nested conditional operators in Java.

10

Switch, break, and default

Calculate a student's grade using a switch statement in Java based on an integer input. Practice using switch, break, and default.

Flow controls: Conditions

Practice with exercises in Java related to the conditions, loops and structures of the language.

Ejercicios prácticos

Seguir aprendiendo

Curso de Programación en C#

Curso de programación gratuito con ejercicios y soluciones prácticas en C#. ¡Comienza a aprender ahora mismo!

Exercises C# App

Lleva tus lecciones de Exercises C# a todas partes con nuestra aplicación para Android. Descárgala ahora desde Google Play.