Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

C for loop factorial value (decrementation)

//for loop factorial value
#include <stdio.h>
main()
{
    int n,f,d;
    f=1;
    printf("
Enter a number: ");
    scanf("%d",&n);
    for(d=n;d>1;d--)
    {
    	printf("%d*",d);
        f=f*d;
    }
    printf("%d",d);
    printf("

The factorial value: %d",f);
}
Source by www.shafaetsplanet.com #
 
PREVIOUS NEXT
Tagged: #C #loop #factorial
ADD COMMENT
Topic
Name
8+1 =