https://github.com/copyleftdev/pascal-wtf
https://github.com/copyleftdev/pascal-wtf
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/copyleftdev/pascal-wtf
- Owner: copyleftdev
- Created: 2023-09-15T06:59:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-15T07:05:07.000Z (over 1 year ago)
- Last Synced: 2023-09-15T22:31:26.160Z (over 1 year ago)
- Language: Pascal
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Factorial Calculator in Pascal
This program, written in Pascal, calculates the factorial of a given number using a recursive approach.
## Overview
The FactorialCalculator prompts the user for an integer input. It then calculates the factorial of the number provided by the user using a recursive function. If a negative number is input, the user will be notified that they should provide a non-negative integer.
## How to Run
### Prerequisites
- A Pascal compiler, such as Free Pascal.
- Knowledge on how to compile and run Pascal programs.### Compilation and Execution
1. Save the provided code into a file named `FactorialCalculator.pas`.
2. Compile the program using a Pascal compiler. For example, using Free Pascal:```bash
fpc FactorialCalculator.pas
```3. After compilation, run the executable:
```bash
./FactorialCalculator
```## Usage
Upon execution, the program will prompt:
```
Enter a number to calculate its factorial:
```Input a non-negative integer and press enter. The program will then display the factorial of the given number. If a negative number is input, you'll be prompted to enter a non-negative integer.