Question: Maybe I am swatting flies with a sledgehammer but...

I was doing this exerice on [CodingBat](http://codingbat.com/prob/p178728);

> 
> Given 2 ints, a and b, return their sum. However, "teen" values in the range [13, 19] are extra lucky. So if either value is a teen, just return 19.
> 
> 
> 

and this is the answer I came up with;

```
public int teenSum(int a, int b)
{
    if (a >= 13 && a <= 19) return 19;
    if (b >= 13 && b <= 19) return 19;
    else return a + b;
}

```

I was wondering if there was a way to solve this problem in just one "if" statement... is there?

Answer: 
If you use a ternary operator (`? :`) you could do it with zero `if` statements. Something like,

```
public int teenSum(int a, int b)
{
    return (a > 12 && a < 20) || (b > 12 && b < 20) ? 19 : a + b;
}

```
You can do it entirely without `if` statements, using the `?:` ternary operator.

```
return (a >= 13 && a <= 19) || (b >= 13 && b <= 19) ? 19 : a + b;

```