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
Plt-D v.0.8.5
see all nodes in given ldap node
C# Abstract Syntax Tree Example: Compiler for a numeric expression
HawkSearch field naming convention
Plt-D v.0.9.4
Print Matrix To Screen (with little pretty box)
BitArrays Are Cool
масиви форіч
problem
XML filtering example