Skip to content

Instantly share code, notes, and snippets.

@tedyblood
Created September 4, 2013 19:56
Show Gist options
  • Save tedyblood/6442050 to your computer and use it in GitHub Desktop.
Save tedyblood/6442050 to your computer and use it in GitHub Desktop.
Determinar si un número entero es positivo o negativo
/*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