Thursday 26 March 2015

FACTORIAL OF N

#include<stdio.h>
#include<conio.h>
void main()
{
int temp,num,fact=1;
clrscr();
printf("\n enter any number:\n");
scanf("%d",&num);
temp=num;
for(;temp>=1;temp--)
 fact=fact*temp;
 printf("\n factorial of %d!=%d",num,fact);
 getch();
 }

No comments:

Post a Comment