I have this code:
bool value = false;
if(value)
{
Console.Write("true");
}
else
{
Console.Write("false");
}
and I want to shorten it by using the conditional operator but I can't find the correct syntax.
bool value = false;
value ? Console.Write("true") : Console.Write("false"); // does not work