Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 1, 2019 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/92893bd3b0d91b52377759ee73678f5c to your computer and use it in GitHub Desktop.
Save parzibyte/92893bd3b0d91b52377759ee73678f5c to your computer and use it in GitHub Desktop.
import java.util.Scanner;
/*
Mayor y menor de edad en Java
@author parzibyte.me
*/
class MayorDeEdad{
public static void main(String[] argumentos){
Scanner escaner = new Scanner(System.in);
int edad;
System.out.println("Dime tu edad: ");
edad = escaner.nextInt();
if (edad >= 18){
System.out.println("Mayor de edad");
}else{
System.out.println("Menor de edad");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment