Created
September 4, 2013 19:56
-
-
Save tedyblood/6442050 to your computer and use it in GitHub Desktop.
Determinar si un número entero es positivo o negativo
This file contains hidden or 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
/*Actividad número 2 | |
Problema 1: Determinar si un número entero es positivo o negativo | |
*/ | |
class Tarea2{ | |
public static void main(String arg[]){ | |
int numero=0; | |
String mensaje=""; | |
numero=Integer.parseInt (arg[0]); | |
mensaje=(numero)>0 ? "Es positivo":"Es Negativo"; | |
System.out.println(numero+" "+mensaje); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment