Ticker

6/recent/ticker-posts

How to write factorial in C program



factorial in C program



#include<stdio.h>
int main()
{
	int i,n,factorial = 1;
	
	printf("Enter the value of n:	");
	scanf("%d", &n);
	for(i=1;i<=n;i++)
	{
		factorial = factorial*i;
	}
	printf("The factorial of given number is 	%d",factorial);
	
	return 0;
}

Post a Comment

0 Comments