Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ex18;
- import java.util.Scanner;
- public class ex18 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int idade;
- System.out.println("Digite sua idade:");
- idade = sc.nextInt();
- if(idade >= 18)
- {
- System.out.println("Você é maior de idade.");
- }
- else
- {
- System.out.println("Você não é maior de idade.");
- }
- }
- }
- // receber idade e mostrar se é de maior ou não
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement