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 |
how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48
int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[]
What is floating point constants?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What is the difference between File pointer and Internal Charecter Pointer?
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
how can i calculate mean,median,mode by using c program
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.
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?
Explain void pointer?
Which are low level languages?