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
When should you not use a type cast?
Are the variables argc and argv are local to main?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is the heap?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
What is return in c programming?
What is a sequential access file?
What is extern c used for?
Explain what is the heap?
Difference between macros and inline functions? Can a function be forced as inline?
the question is that what you have been doing all these periods (one year gap)
What are bitwise shift operators in c programming?
How can I do graphics in c?