Step 1: The ternary operator is right associative, so it reads as \( a > 2 \; ? \; (a < 5 \; ? \; 10 : 20) : 30 \).
Step 2: Check the outer condition. Is \( a > 2 \)? Here \( 5 > 2 \) is true, so we move to the inner ternary.
Step 3: Check the inner condition. Is \( a < 5 \)? Here \( 5 < 5 \) is false, so it returns 20.
Step 4: println prints 20. Answer is (C).