Example 1: C# program to find the factorial of a given number
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet run ——————————————————————————————————————————— Program to find the factorial of a number ——————————————————————————————————————————— Enter the number 16 Factorial of 16 is 20922789888000 ——————————————————————————————————————————— kodingwindow@kw:~/csharp$
Example 2: C# program to find the factorial of a given number
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet run ——————————————————————————————————————————— Program to find the factorial of a number ——————————————————————————————————————————— Enter the number 0 Factorial of 0 is 1 ——————————————————————————————————————————— kodingwindow@kw:~/csharp$
What Next?
C# program to print the Fibonacci series
C# program to print the Fibonacci series using recursion
C# program to print the Armstrong numbers
Advertisement