Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
recursivefact
//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 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static long factorial (int n ) { if (n<=0) { Console.WriteLine("enter no > 0"); } if (n==1) { return 1; } long fact = 1; fact = n * factorial(n-1); return fact; } public static void Main(string[] args) { int n = 5; Console.WriteLine(factorial(n)); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Par ou ímpar
Unity Wall Climbing script Version 1
30272 Program Ex3
SSTR PARS
Anagrams String
Конструктор класса
bellman ford algo
Added Carnival, List Matching
Test date/time bug
OddEven
Please log in to post a comment.