- Online Exam Test Papers | - MCQs[multiple choice questions and answers ] | - Mock Test Papers | - Practice Papers | - Sample Test Papers |

Question:
Suppose you want to eliminate duplicate elements from the array
int[] source = { 7, 4, 1, 3, 9, 8, 6, 7, 2, 1, 8, 15, 8, 23}

and sort the elements in descending order using LINQ in .Net framework 4.0. Which of the following statements can you use?

1.var result = (from s in source orderby s select distinct s).Descending();

2.var result = (from s in source orderby s descending select s).Distinct();

3.var result = select distinct s from s in source sortby s descending;

4.var result = from s in source orderby s descending group p by s select s;

Posted Date:-2022-08-15 13:02:02


More MCQS Questions and answers

Search