Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


c program to manipulate x=1!+2!+3!+...+n! using recursion



c program to manipulate x=1!+2!+3!+...+n! using recursion..

Answer / satya

#include<stdio.h>
#include<conio.h>
int sumfact(int n)
{ int cnt=0,out;
if(cnt==0)
out=1;
if(n==1)
return out;
else
{
int i,fact=1;
for(i=n;i>=2;i--)

fact*=i;
out+=fact;
cnt++;

return out+sumfact(n-1);
}
}
main()
{
int out,n;
clrscr();
printf("Enter the vlue of n ");
scanf("%d",&n);
out=sumfact(n);
printf("%d",out);
getch();
}

Is This Answer Correct ?    6 Yes 6 No

Post New Answer

More C Interview Questions

find the sum of two matrices and WAP for it.

0 Answers   Huawei,


Does c have class?

0 Answers  


Can you explain the four storage classes in C?

0 Answers   TCS,


the question is that what you have been doing all these periods (one year gap)

0 Answers   HCL,


what is the program to display your name in any color?

2 Answers   HCL,


How can I get the current date or time of day in a c program?

0 Answers  


What are structure types in C?

0 Answers  


write a program to convert a expression in polish notation (postfix) to inline (normal)

0 Answers   Siemens,


main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }

4 Answers   CTS,


a=(1,2,3); b=1,2,3; c=1,(2,3); d=(1,2),3; what's the value of 'a','b','c','d'

2 Answers  


what is pointer ?

10 Answers   Kernex Micro Systems,


Prove or disprove P!=NP.

5 Answers   Microsoft,


Categories