C sharp output type question
Q. Choose the correct one.
int[] numbers = { 5, 4, 11, 3, 9, 8, 6, 7, 2, 0 };
var nums = numbers.Skip(4);
foreach (var n in nums)
{
Console.Write(n+” “);
}
- Published on 31 Aug 15a. 9867 2 0
b. 5411398
c. 54113
d. None of the above
ANSWER: 9867 2 0
Skip method ignored a specified number of elements in a sequence and then returns the remaining elements.
In the above code snippet, Skip(4) function will ignore the first four elements from array
int[] numbers = { 5, 4, 11, 3, 9, 8, 6, 7, 2, 0 };