CSharp examples for System:Math Geometry
Calculates n factorial
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*ww w.j av a 2 s . c om*/ public class Main{ /// <summary> /// Calculates n factorial /// </summary> /// <param name="n"></param> /// <returns>int</returns> public static int Factorial(int n) { if (n <= 1) return 1; return n * Factorial(n - 1); } }