14 Write programs to find and display the sum of the given series 1+1/2!+....+1/n! ?
Answers
Answered by
1
int main()
{
int num,i,sum=0;
printf("Input any number: ");
scanf("%d",&num);
printf("1 + ");
for(i=2;i<=num-1;i++)
printf(" 1/%d +",i);
for(i=1;i<=num;i++)
sum = sum + i;
printf(" 1/%d",num);
printf("\nSum = 1/%d",sum+1/num);
return 0;
}
Similar questions
Math,
7 hours ago
Math,
13 hours ago
Computer Science,
13 hours ago
Political Science,
8 months ago
Math,
8 months ago