How to check if all array elements are strictly positive?

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

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