Friday 31 August 2012

FACTORIAL OF A NUMBER

#include<stdio.h>
#include<conio.h>
void main()
{
int n,f;
f=1;
printf("Enter the number:\n");
scanf("%d",&n);

while(n>0)
{
printf("%d",n);
f=f*n;
n--;
}
printf("The factorial of the integer is:%d",f);
getch();
}

No comments:

Post a Comment