if (A)
{
return B ? "W" : "X";
}
return B ? "Y" : "Z";
Or even more terse:
return A ? (B ? "W" : "X")
: (B ? "Y" : "Z");
If your going for exclusively unnested conditions:
if (A && B) return "W";
if (A && !B) return "X";
return B ? "Y" : "Z";