import java.util.Scanner;
class Test
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter any Number= ");
int n = sc.nextInt();
if(n<=21)
{
int c=21-n;
System.out.print(c);
}
else
{ int d=n-21;
System.out.print(2*d);
}
}
}
class Test
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter any Number= ");
int n = sc.nextInt();
if(n<=21)
{
int c=21-n;
System.out.print(c);
}
else
{ int d=n-21;
System.out.print(2*d);
}
}
}
No comments:
Post a Comment