Describe for loop and write a c program to sum the series
X + x2/2! + x3 /3! + …….. up to fifteen terms.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sai
#include<math.h>
void main()
{
int i,sum=0,x;
clrscr();
printf("enter x value");
scanf("%d",&x);
for(i=1;i<=15;i++)
sum=sum+((x*i)/fact(i));
printf("sum of x+x2/2!.......x15/15!=%d",sum);
getch();
}
Is This Answer Correct ? | 10 Yes | 13 No |
What are loops c?
Write the syntax and purpose of a switch statement in C.
what is pointer ? what is the use of pointer?
What is the symbol indicated the c-preprocessor?
Reverse the part of the number which is present from position i to j. Print the new number. eg: num=789876 i=2 j=5 778986
What is hash table in c?
How to write in a function declaration and in function call in which the function has 'n' number of varible or arguments?
How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal)
Describe wild pointers in c?
What is the collection of communication lines and routers called?
How can you find the exact size of a data type in c?
What are different types of pointers?