//GET: /Reeksen/ public IActionResult Index() { StringBuilder sb = new StringBuilder(); var allNumbers = rs.GeefReeks(10, 20); sb.Append("Getallenreeks\r\n"); foreach (int n in allNumbers) { sb.Append($"{n.ToString()} \r\n"); } var evenNumbers = rs.GeefReeksEven(10, 20); sb.Append("Even getallen\r\n"); foreach (int e in evenNumbers) { sb.Append($"{e.ToString()} \r\n"); } var primes = rs.GeefPriemGetallen(10, 20); sb.Append("Priemgetallen\r\n"); foreach (int p in primes) { sb.Append($"{p.ToString()} \r\n"); } return(Content(sb.ToString())); }
public static void Main(string[] args) { Task getNormal = StringConv("Hello Async!", TekstMode.Normal); getNormal.Wait(); Task getReverse = StringConv("Hello Async!", TekstMode.Reverse); getReverse.Wait(); Task getAscii = StringConv("Hello Async!", TekstMode.Ascii); getAscii.Wait(); IList <string> outputStrs = new List <string>(); var allNumbers = x.GeefReeks(10, 20); outputStrs.Add("All numbers from min to max:"); foreach (int a in allNumbers) { outputStrs.Add(a.ToString()); } var evenNumbers = x.GeefReeksEven(10, 20); outputStrs.Add("All even from min to max:"); foreach (int e in evenNumbers) { outputStrs.Add(e.ToString()); } var primes = x.GeefPriemGetallen(10, 20); outputStrs.Add("All primes from min to max:"); foreach (int e in primes) { outputStrs.Add(e.ToString()); } Print(outputStrs); Console.ReadKey(); }
public IActionResult Index() { ReeksService eenService = new ReeksService(); string teruggave = "Priem Getallen:"; foreach (int getal in eenService.GeefPriemGetallen(10, 20)) { teruggave += "\n " + getal.ToString(); } teruggave += " \n Even Getallen:"; foreach (int getal in eenService.GeefReeksEven(10, 20)) { teruggave += "\n " + getal.ToString(); } teruggave += " \n getallen Reeks:"; foreach (int getal in eenService.GeefReeks(10, 20)) { teruggave += "\n " + getal.ToString(); } return(Content(teruggave)); }