In The Following C Code Which Query Will Work According To The #657
In the following C# code, which query will work according to the set of code?</p> <pre><code class="language-csharp" line="1"> class Program { static void Main(string[] args) { int[] nums = { 1, -2, 3, 0, -4, 5 }; int len = /*_________________ */ Console.WriteLine("The number of positive values in nums: " + len); Console.ReadLine(); } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Delegates, Generics and LINQ - Operation and Query with LINQ - Quiz No.1.
In the following C# code, which query will work according to the set of code?
class Program { static void Main(string[] args) { int[] nums = { 1, -2, 3, 0, -4, 5 }; int len = /*_________________ */ Console.WriteLine("The number of positive values in nums: " + len); Console.ReadLine(); } }
from n in nums where n > 0 select n
from n in nums where n > 0 select n.Count()
(from n in nums where n > 0 select n).Count();
Both "from n in nums where n > 0 select n.Count()" & "(from n in nums where n > 0 select n).Count();"