-
-
Save parzibyte/131a62a3ddafc4f18b50f88bf4155428 to your computer and use it in GitHub Desktop.
This file contains 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 java.util.Scanner; | |
class Main { | |
public static void main(String[] args) { | |
Scanner escaner = new Scanner(System.in); | |
// Mandar mensaje | |
System.out.println("Escribe un número:"); | |
// Leer lo que se introduce | |
double numero = escaner.nextDouble(); | |
// Comparar | |
if (numero == 0) { | |
System.out.println("El número es neutro"); | |
} else if (numero < 0) { | |
System.out.println("El número es negativo"); | |
} else { | |
System.out.println("El número es positivo"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment