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
Explain why c is faster than c++?
What is the difference between int main and void main?
Write a program of prime number using recursion.
What is typedef example?
Explain what is operator promotion?
Compare and contrast compilers from interpreters.
What is the difference between typedef and #define?
State the difference between realloc and free.
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(); }
State the difference between x3 and x[3].
How do you write a program which produces its own source code as output?
Explain heap and queue.
Is that possible to store 32768 in an int data type variable?
What is the description for syntax errors?
Explain what is the difference between #include and #include 'file' ?