6️⃣C Program to Find Factorial of a Number(With Program and Explanation)
๐ C Program to Find Factorial of a Number
(With Program and Explanation)
๐น What is Factorial?
The factorial of a number n is:
Example:
-
5! = 5 × 4 × 3 × 2 × 1 = 120
๐ป C Program Code
๐ง How the Program Works
-
User enters a number
-
If the number is negative, factorial is not defined
-
Loop multiplies numbers from 1 to n
-
Result is stored in
factorial
▶️ Sample Output
Comments
Post a Comment