Saturday, June 26, 2010

wap to find factorial of any no.

#include

#include
void main( ) 

int n,x,fact;
clrscr( );
printf("Enter any no. :");
scanf("%d",&n); 
fact =1; 
for (x=1;x<=n;x++)

fact=fact*x; 

printf("factorial of %d is %d",n,fact);
getch( );
}

No comments:

Post a Comment