Back
Close

C# || Operator - AmieDD

amiedd
1,947 views

C# || Operator Reference

C# code - No need to download anything, this code works in your browser

AmieDD www.amiedd.com Code, Cosplay, and Games

// { autofold
bool SecondOperand()
{
Console.WriteLine("Second operand is evaluated.");
return true;
}
bool a = true || SecondOperand();
Console.WriteLine(a);
// Output:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

About C# || Operators

The conditional logical OR operator || calculates the logical OR of its bool operands. The result of x || y is true if either x or y evaluates to true. If not the result is false. If the first operand evaluates to true, the second operand is not evaluated and the result of operation is true.

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants