Describe for loop and write a c program to sum the series
X + x2/2! + x3 /3! + …….. up to fifteen terms.

Answer Posted / gouthami chintala

#include<stdio.h>
#include<conio.h>
void main()
{
int sum=0;
int x,i,j,c=1;
printf("enter a value for a x);
scanf("%d",&x);
for(i=1;i<=15;i++)
{
for(j=i;j<=1;j--)
{
c=c*i;
}
sum=sum+(x/c);
}
printf("the value of x+x/2!+x/3!----- for the given x value
is");
printf("%d",sum);
}

Is This Answer Correct ?    24 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain why c is faster than c++?

566


What is the difference between int main and void main?

569


Write a program of prime number using recursion.

611


What is typedef example?

610


Explain what is operator promotion?

626






Compare and contrast compilers from interpreters.

676


What is the difference between typedef and #define?

534


State the difference between realloc and free.

621


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

1855


State the difference between x3 and x[3].

648


How do you write a program which produces its own source code as output?

599


Explain heap and queue.

575


Is that possible to store 32768 in an int data type variable?

685


What is the description for syntax errors?

607


Explain what is the difference between #include and #include 'file' ?

572