Skip to main content
3 of 3
"i think you need to set the seed 1 , other wise it return you 0." (confirm/deny?)
Timtech
  • 12.7k
  • 2
  • 47
  • 63

C#, just the relevant code, 59

(assuming the argument variable is called a)

Enumerable.Range(1,int.Parse(a[0])).Aggregate(1,(x,y)=>x*y) 

With boilerplate, 122

using System.Linq;class A{static int Main(string[] a){return Enumerable.Range(1,int.Parse(a[0])).Aggregate(1,(x,y)=>x*y);} 

(note that this solution returns the result)