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

what do u mean by Direct access files? then can u explain about Direct Access Files?

0 Answers   LG Soft,


In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?

4 Answers  


Write program to remove duplicate in an array?

0 Answers  


can we initialize all the members of union?

2 Answers  


Can you mix old-style and new-style function syntax?

0 Answers  


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

0 Answers  


what is c language?

2 Answers  


what is the use of keyword volatile??

4 Answers   LG Soft,


errors in computer programmes are called

1 Answers   NET,


What is the use of getch ()?

0 Answers  


#define MAX 3 main() { printf("MAX = %d \n",MAX ); #undef MAX #ifdef MAX printf("Vector Instituteā€); #endif

4 Answers   IBM, Vector,


Is a house a shell structure?

0 Answers  


Categories