Advertisement
cesarnascimento

ex18 cap 4

Mar 28th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. package ex18;
  2. import java.util.Scanner;
  3. public class ex18 {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         int idade;
  8.         System.out.println("Digite sua idade:");
  9.         idade = sc.nextInt();
  10.        
  11.         if(idade >= 18)
  12.         {
  13.         System.out.println("Você é maior de idade.");
  14.         }
  15.         else
  16.         {
  17.         System.out.println("Você não é maior de idade.");   
  18.         }
  19.  
  20.     }
  21.  
  22. }
  23. // receber idade e mostrar se é de maior ou não
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement