The ones who are crazy enough to think they can change the world are the ones who do.- Steve Jobs
Mathematically, factorial of any number means to multiply a series of desecending natural numbers ie) upto 1.
Here is the most impressive structures built by humans in ancient time "The Pyramids".
Let us write a c program to find factorial for user entered number
#include <stdio.h> int main() { int a, i; printf("Enter a number: "); scanf("%d",&a); for(i = a-1;i > 0;i--) { a *= i; } printf("%d ",a); return 0; }
Enter a number : 5 Factorial of 5 is 120
By closely looking at for-loop will give you a clear idea. Limit for a variable i is set from a-1 to 1 which is multiplied with the product of user entered number for every iteration.
We may make mistakes(spelling, program bug, typing mistake and etc.), So we have this container to collect mistakes. We highly respect your findings.
© Copyright 2019