This PR adds a function to calculate the factorial of a given number using an iterative approach. The result is printed to the console.
Test Plan
Enter a positive integer (e.g., 5). Expect output: The factorial of 5 is: 120.
Test with 0. Expect output: The factorial of 0 is: 1.
Input a negative integer (e.g., -3) to ensure graceful handling of invalid inputs.
What does this PR do?
This PR adds a function to calculate the factorial of a given number using an iterative approach. The result is printed to the console.
Test Plan
Enter a positive integer (e.g., 5). Expect output: The factorial of 5 is: 120. Test with 0. Expect output: The factorial of 0 is: 1. Input a negative integer (e.g., -3) to ensure graceful handling of invalid inputs.
Related PRs and Issues None.
Have you read the Contributing Guidelines on issues? Yes.