Hi, I have made changes to my code according to your suggestions. One thing I am wondering is my function needs to return an int because this is how I declare it before the function name but you mentioned using unsigned long which I added as a local variable which means I have different types...
My factorial program does not give me the correct results in cases, for instance 13 should be 6227020800 and my output is 1932053504. I display my C program below, is someone able to help me fix it for these cases? I know the formula for factorial is n × (n - 1).
int factorial(int nb)
{...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.