Created
August 1, 2019 15:18
-
-
Save parzibyte/92893bd3b0d91b52377759ee73678f5c to your computer and use it in GitHub Desktop.
Mayor de edad en Java - https://parzibyte.me/blog/2018/11/19/mayor-menor-de-edad-varios-lenguajes-de-programacion/
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; | |
/* | |
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