Created
May 5, 2021 20:55
-
-
Save meetKazuki/741caeb53758fa8641acf440e1b43d6b to your computer and use it in GitHub Desktop.
A Pascal program that reads a positive integer N and tabulate the factorials of the number from 1 to N.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
WIP: This solution uses recursive factorial definition. | |
At the moment, this solution does not satisfy the complete requirements | |
of the problem statement. If I'm given enough time, I can implement a | |
solution that will match the specifications. | |
*) | |
program factorial; | |
function factorial(number: integer): longint; | |
begin | |
if (number = 0) then | |
factorial := 1 | |
else | |
factorial := number * factorial(number - 1); | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment