[C] Factorial function - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Programming with C++ (https://www.supportforums.net/forumdisplay.php?fid=20) +---- Thread: [C] Factorial function (/showthread.php?tid=12731) |
[C] Factorial function - Commodore - 10-13-2010 Yes, another silly function. This time it finds the factorial of a number. Usage: Code: factorial(number); Code: Code: long factorial(long x) Please be aware that any input number greater than 31 will not produce a useful result. This is because long integers cannot store numbers greater than the factorial of 31. Sorry. RE: [C] Factorial function - RANA - 11-28-2010 a better program Code: #include <stdio.h> |