0
just found a way to find factorial without recursion
//just found a way to find factorial without recursion static int fact(int x) { int temp = 1, val=x; for (int i = 1; i < val; i++) { x=x * (temp); temp++; } return x; } static void Main(string[] args) { Console.WriteLine( fact(0)); }
1 ответ
+ 10
Are you sure fact(0) will return 1?