In the following C# code, what does the output represent? [code] class Program { static void Main(string[] args) { int[]

Huyền Thu

New member
In the following C# code, what does the output represent?
Code:
class Program
{
    static void Main(string[] args)
    {
        int[] nums = { 1, -2, 3, 0, -4, 5 };
        var posNums = from n in nums
                      where n > 0
                      select n;
        int len = posNums.Count();
        Console.WriteLine(len);
        Console.ReadLine();
    }
}
A. Execution of code with nothing being printed
B. Execution of code with printing all numbers
C. Execution of code with counting total numbers greater than zero
D. Run time error
 

Tìm kiếm

Back
Top