Write a program to compute the following
1!+2!+...n!
Answer Posted / ashish
#include<stdio.h>
int n_fact(int n);
void main()
{
int n,res;
printf("ENTER A NUMBER:-");
scanf("%d",&n);
res=n_fact(n);
printf("%d",res);
}
int n_fact(n)
{
int result;
if(n=0)
result=1;
else
result=n*n_fact(n-1);
return(result);
}
| Is This Answer Correct ? | 5 Yes | 6 No |
Post New Answer View All Answers
What is linear search?
How will you find a duplicate number in a array without negating the nos ?
FILE PROGRAMMING
Explain how can I manipulate strings of multibyte characters?
What is the difference between variable declaration and variable definition in c?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
How many types of sorting are there in c?
What are the benefits of c language?
Explain pointers in c programming?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
I need testPalindrome and removeSpace
#include
Explain high-order bytes.
Can you write the algorithm for Queue?
If errno contains a nonzero number, is there an error?
What is a file descriptor in c?