AF
1. Feel Free to ask and submit anything on Anyforum.in and get satisfactory answer
3. Our Experts are looking for yours ?.

# corejava-programming: Check whether a given number is teen or not?

 We´ll say that a number is "teen" if it is in the range 13 to 19 inclusive. Given 2 integer values, print the number that is the teen range. Sample Input: 12 14 Sample Output: 12 and 14 both are teen numbers Sample Input: 21 25 Sample Output: 21 and 25 both are not teen numbers Sample Input: 17 89 Sample Output: 17 is a teen number Template: import java.util.*; public class Program3 { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); //Write your code here } } corejava x 353programming x 168 Posted On : 2016-12-23 10:54:03.0 Navin Kumar 600 4

 Check this code and let me know if your conditions satisfied or not. import java.util.Scanner; class TeenNumbers { public static void main(String args[]) { Scanner s=new Scanner(System.in); int a=s.nextInt(); int b=s.nextInt(); if((a>=13&&a<=19)&&(b>=13&&b<=19)) { System.out.println(a+"and"+b+"both are teen numbers"); } else if((a>=13&&a<=19)||(b>=13&&b<=19)) { if(a>=13&&a<=19) { System.out.println(a+"is a teen number"); } else { System.out.println(b+"is a teen number"); } } else { System.out.println(a+"and"+b+"both are not teen numbers"); } } } Posted On : 2016-12-24 01:04:37 Satisfied : 5 Yes  0 No 4
out of 4 0 test case passed
nav raj
12  0  0
Posted On :2016-12-24 19:34:24.0