ghostmkg / programming-language

You write code in any programming language you want. And push the code.
33 stars 79 forks source link

Factorial of a Number #97

Closed Jadu07 closed 17 hours ago

Jadu07 commented 1 day ago

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.

Jadu07 commented 20 hours ago

Plese accept PR pls 🙏