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
How can you find the exact size of a data type in c?
What are keywords c?
How many parameters should a function have?
What does. int *x[](); means ?
Explain goto?
What are the types of data structures in c?
Explain how to reverse singly link list.
write a program to generate address labels using structures?
Is there any data type in c with variable size?
In a byte, what is the maximum decimal number that you can accommodate?
What is the process to generate random numbers in c programming language?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
Why c is called a middle level language?
Difference between malloc() and calloc() function?
What is a null string in c?