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 |
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
what are the general concepts of c and c++
Write a program to use switch statement.
0 Answers Agilent, Integreon, ZS Associates,
convert 12345 to 54321 withoutusing strig
What is the scope of an external variable in c?
main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }
Explain the difference between struct and union.
How do you define a string?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Explain how can you check to see whether a symbol is defined?
Program to swap the any two elements in an array containing N number of elements?
1 Answers Bosch, Glenwood, Ugam Solutions,
When the macros gets expanded?