Full width home advertisement

Java

Tech News

Ad

Write c program to find factorial of given number 



#include<stdio.h>
#include<conio.h>

void main()
{
	int n=1,fact=1;
	clrscr();
	printf("Enter the number: ");
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
	fact=fact*i;
	}
	printf("factorial of %d is =%d\n",n,fact);
	getch();
}

Thank you for visiting seeya again

No comments:

Post a Comment

Bottom Ad [Post Page]