Question:How will you count the odd numbers from the array shown below using LINQ in .Net framework 4.0? int[]numbers={5,4,1,3,9,8,6,7,2,0}; 

A int findoddNumbers = numbers.Count(n => n % 2 == 1); 

B int findoddNumbers = numbers.Count( n % 2 == 1); 

C int findoddNumbers = (from number in numbers where numbers%2==1 select Count()); 

D int findoddNumbers = (from number in numbers where number%2==1 select numbers).Count(); 

+ Answer
+ Report
Total Preview: 1012

Copyright © 2024. Powered by Intellect Software Ltd