Question: When I run the following code

```
public class Program
{
    public static void Main()
    {
        string s = "480";
        Console.WriteLine(1 == -1 ? 0 : s[1]);
        Console.WriteLine(s[1]);
    }
}

```

I get 

```
56
8

```

I don't understand how I get 56.

Answer: 
From the [Documentation on the ?: Operator](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/conditional-operator:)

> 
> "Either the type of first\_expression and second\_expression must be the same, or an implicit conversion must exist from one type to the other."
> 
> 
> 

and 

> 
> "The conditional operator is right-associative."
> 
> 
> 

So your result becomes a numeric in the first case, and a char in the second case.
> 
> I don't understand how I get 56.
> 
> 
> 

in the first line it is interpreted as UTF-16 code of the char `8`:

```
Console.WriteLine(1 == -1 ? 0 : s[1]);

```

Using the conditional operator you give here the choice between an `int` `0` and a `char` so the compiler converts the latter implicitly to an `int` (which gives you the UTF-16 code) and prints it to the console

and in the second line you actually get the `char` value printed

```
Console.WriteLine(s[1]);

```

No implicit conversion happens here.