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

how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48

1 Answers  


int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[]

6 Answers   Hughes,


What is floating point constants?

0 Answers  


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

0 Answers  


What is the difference between File pointer and Internal Charecter Pointer?

2 Answers   TATA,


my name is nani i completed my b-tech in hyd now i want go for interveiw but i dont know the process of software field interveiws plz help me anyone how many rouds there n what rounds plz plz plz help me n where i can get these details

2 Answers  


how can i calculate mean,median,mode by using c program

1 Answers   HCL,


A array contains dissimilar element how can we count, and A array contains dissimilar element how can we store in another array with out repetition.

4 Answers  


write a c program to find the square of a 5 digit number and print the result.

5 Answers   Accenture, Sasken, Vimukti Technologies,


What is #include stdlib h?

0 Answers  


Explain void pointer?

0 Answers  


Which are low level languages?

0 Answers  


Categories