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
https://www.compliantmechanisms.byu.edu/profile/new-free-robux-generator-2022/profile
File_operations
nested try catch
Ordinalator
3
Delegates
Creating async methods in C# prior to version 5.0
Collatz Conjecture Using Pi
Two lines of Random number
Class Objects