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
Write a program to print factorial of given number using recursion?
How can I open files mentioned on the command line, and parse option flags?
Why is C language being considered a middle level language?
What are the advantages and disadvantages of c language?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What are the 5 organizational structures?
What does dm mean sexually?
What is modifier & how many types of modifiers available in c?
What is the c value paradox and how is it explained?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
What is difference between structure and union with example?
Is array name a pointer?
When should structures be passed by values or by references?
What is the size of array float a(10)?
What is pointer to pointer in c language?