lenelex.com
Home
Quizzes
Games
Register
Log in
Question 1 of 14
What is the output of the program below?
class Program { delegate bool D(double x); static void Main() { double num = 4.0; D[] rules = { x => x >= 0, x => x % 1==0, x => x % 2 ==0}; Validate(num, rules); } static void Validate(double num, D[] rules) { var v = true; foreach (D val in rules) { v &= val(num); } Console.Write(v); } }
A. True False True
B. False
C. True
D. True True True
Links:
Delegates
delegate
The OR Assignment Operator