know the personalities
hold your mouse,move left and right

C Program For FACTORIAL USING RECURSION.




C Program For FACTORIAL USING RECURSION.

#include<stdio.h>
#include<conio.h>
void main()
{
int n,f;
clrscr();
printf("Enter the n value:");
scanf("%d",&n);
f=fact(n);
printf("factorial value is=%d",f);
getch();
}
int fact(int a)
{
int c=1;
if(a==1)
{
return(1);
}
else
{
a=a*fact(a-1);
//printf("%d\n",c);
return (a);
}
}

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com