Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
One liner recursive prime generator
using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { IEnumerable<int> primes = null; primes = Enumerable.Range(0,int.MaxValue).Where(x=>x==2||(x>2&&primes.TakeWhile(p=>p<=Math.Sqrt(x)).All(p=>x%p!=0))); primes.TakeWhile(x=>x<=1000).ToList().ForEach(Console.WriteLine); } } }
run
|
edit
|
history
|
help
1
Simple Constructor Implementation
Doubt-" 1 parameter Gen _Derive_Class inherit the 2 parameter Gen_Base_Class"
Intuit // C# // listing_4.11 (break // ryad Teylora..)
ew
Floyd’s Warshall Algorithm
30272 ProgramEX8 For&While
Selection sort
EMV_RESULTAT
Try-Catch-TaskRun
6