Created
October 11, 2013 01:20
-
-
Save kalebr/6928204 to your computer and use it in GitHub Desktop.
c# count elements below value in list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
List<double> f = new List<double>(); | |
Random r = new Random(); | |
for (int i = 0; i < 20; i++) | |
{ | |
f.Add(r.NextDouble() * 100); | |
} | |
List<double> c = f.FindAll(n => n <= 50.0); | |
foreach (double n in c) | |
{ | |
System.Console.WriteLine(n); | |
} | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment