lenelex.com
Home
Quizzes
Games
Register
Log in
Question 1 of 20
What is the output of the following code fragment?
Func<int, bool> eval = x => { Console.Write($"eval({x}) "); return x > 0; }; bool b = eval(1) || eval(0); Console.Write($"output: {b}");
A. eval(1) eval(0) output: True
B. eval(1) eval(0) output: False
C. eval(1) output: False
D. eval(1) output: True
Logical OR (||)
If the first operand is true, then the second operand is not evaluated.
Links:
The Conditional OR Operator (||)
Func<T,TResult> Delegate