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
When we use void main and int main?
What is far pointer in c?
Is array a primitive data type in c?
What are the preprocessor categories?
What are data types in c language?
which type of aspect you want from the student.
How can you increase the allowable number of simultaneously open files?
How can type-insensitive macros be created?
What is an lvalue in c?
How can I remove the leading spaces from a string?
Do character constants represent numerical values?
Why is it usually a bad idea to use gets()? Suggest a workaround.
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
How do I use strcmp?
What is difference between constant pointer and constant variable?