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 |
find the sum of two matrices and WAP for it.
Does c have class?
Can you explain the four storage classes in C?
the question is that what you have been doing all these periods (one year gap)
what is the program to display your name in any color?
How can I get the current date or time of day in a c program?
What are structure types in C?
write a program to convert a expression in polish notation (postfix) to inline (normal)
main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }
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'
what is pointer ?
10 Answers Kernex Micro Systems,
Prove or disprove P!=NP.