How to check if all array elements are strictly positive?

 Posted by Niladri.Biswas on 6/13/2013 | Category: C# Interview questions | Views: 1474 | Points: 40
Answer:

If you want to check whether everything is strictly positive, use:

bool allPositive = array.All(x => x > 0);


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response