P
P
ProblemBook.NET
Search
⌃K
P
P
ProblemBook.NET
Search
⌃K
ProblemBook.NET
LANGS
Задачник.NET
ProblemBook.NET
Oop
Strings
Linq
“YieldExceptionYield” (Problem)
“QueryAfterRemove” (Problem)
“ClosureAndVariable” (Problem)
“QueryWithInc” (Solution)
“QueryWithInc” (Problem)
“LifeAfterYield” (Solution)
“LifeAfterYield” (Problem)
“EnumerableToArray” (Solution)
“EnumerableToArray” (Problem)
«YieldExceptionYield» (Solution)
“ExceptionYieldYield” (Solution)
“ClosureAndForeach” (Solution)
“TryYieldFinally” (Problem)
“ClosureAndFor” (Solution)
“ExceptionYieldYield” (Problem)
“YieldExceptionYield” (Solution)
“ClosureAndForeach” (Problem)
“ClosureAndVariable” (Solution)
“QueryAfterRemove” (Solution)
“ClosureAndFor” (Problem)
Multithreading
ValueTypes
Math
Summary
Introduction
Attribution-NonCommercial-NoDerivatives 4.0 International
Powered By GitBook

“ClosureAndForeach” (Problem)

What will the following code display?
var actions = new List<Action>();
foreach (var i in Enumerable.Range(1, 3))
actions.Add(() => Console.WriteLine(i));
foreach (var action in actions)
action();
​Solution​
Previous
“YieldExceptionYield” (Solution)
Next
“ClosureAndVariable” (Solution)
Last modified 4yr ago
Copy link