Small factorials in C#

0

I spent some time looking but was unable to find a successful submission for the Small Factorials practice written in C#. When I submit the following code it comes up with "Wrong Answer" despite it working on my desktop and being tested using files as mentioned in the FAQ section. The test cases presented in the explanation also seem to work correctly.

My hypothesis is that the test cases are using a very large factorial number, e.g. 25!,50! or 67!, which is causing my program to output an incorrect number. I am using the ulong data type which is the second to largest in .NET. I can't use the BigInteger type because it isn't included in the default library types.

If I am incorrect could someone please point out the flaw in my code or let me know where I made a mistake?

statement says: "1<=n<=100" so there can be test case where n = 100, so your hypothesis is correct. I do not know if you can use BigInteger here, in Java you can. Another approach is to implement multiplication as you learned it in school: