Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
n!/x*x
using System; namespace Rextester { public class Program { public static void Main(string[] args) { int n = 3; int x = 2; decimal result = 1.00000m; for (int i = 1; i <= n; i++) { result = (result + (GetFactorial(i)/ (decimal) Math.Pow(x, i))); } Console.WriteLine(Math.Round(result,5)); } public static decimal GetFactorial(int n) { decimal result = 1; for (int i = n; i > 1; i--) { result = result * i; } return result; } } }
run
|
edit
|
history
|
help
0
a
Check if string is palindrome
9
asifuesire
XML filtering example
2015-2 matrix threads
Robot_Testing
remove special char c#
UnityCubo
Task 1_4