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 |
main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
how to build a exercise findig min number of e heap with list imlemented?
what are far pointers?
what is meant by flushll() in c programming?
C passes By value or By reference?
5 Answers Geometric Software, Infosys,
what is the difference between NULL & NUL keywords in C?
34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
0 Answers MAHINDRA, Protech, Sivan Tech,
What are the different flags in C? And how they are useful? And give example for each in different consequences?
Why does not use getgh(); and <conio.h> in c language.
What is derived datatype in c?