erweiterung

This commit is contained in:
2023-03-23 15:55:13 +01:00
parent 33e49f846c
commit 09c8eab938
39 changed files with 1167 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
using System.Net.Sockets;
using System.Runtime.ExceptionServices;
namespace BeispielRekusion
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine(FatultaetRekursiv(16062));
}
static long FakultaetIterativ(int n)
{
long ergebnis = 1;
for (int i = 1; i <= n; i++)
{
ergebnis = ergebnis * i;
}
return ergebnis;
}
static ulong FatultaetRekursiv(ulong n)
{
if (n == 1)
{
return 1;
}
else
{
return n * FatultaetRekursiv(n-1);
}
}
}
}