Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Print 1 to 100 without using loop
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 //How will you print numbers from 1 to 100 without using loop? //Solution that prints numbers using recursion. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; //DEVELOPER: PANNA CHATTERJEE namespace Rextester { public class Program { public static void Main(string[] args) { PrintNumbers(100); } // Prints numbers from 1 to n static void PrintNumbers(int n) { if(n > 0) { PrintNumbers(n - 1); Console.Write(n + " "); } return; } } }
run
|
edit
|
history
|
help
0
Fórum SO ➡ Merging 2 lists by Name and adding their Values, using LINQ ♦
DB Search
Ggj
find maximum consecutive repeating character
1
3
4341
BiologyQuestions
Print Matrix To Screen (with little pretty box)
Download a .NET assembly, and execute a static, parameterless method.