Computer Science, asked by sujit1970dutta, 8 months ago

write a program in Java using scanner to accept age of a person and display child of teenager or adult child age is less than 13 teenager between 13 and 18 adult greater than 18​

Answers

Answered by Aryansingh001
10

it may help you!! sujit 1970 dutta

import java.util.Scanner;

public class AgesScanner {

public static void main(String Args[]) { System.out.print("Enter the Age: ");

Scanner in = new Scanner(System.in);

int i = in.nextInt();

in.close();

if (i >= 0 && i <= 5) {

System.out.println("Infant"); .

} else if (i >= 6 && i <= 17) {

System.out.println("Child");

} else if (i >= 18) {

System.out.println("Adult");

}else

{ System.out.println("Invalid input");

}

}

}

plz mark me as a brainiliest plz

Similar questions