Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC#expression treesSingle-choice MCQ

You build an expression and compile it as shown. What does running the compiled delegate return?

var p = Expression.Parameter(typeof(int), "x"); var body = Expression.Add(p, Expression.Constant(10)); var lambda = Expression.Lambda<Func<int, int>>(body, p); var f = lambda.Compile(); int result = f(5);