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



Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fift..

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

Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fift..

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

Post New Answer

More C Interview Questions

What are loops c?

0 Answers  


Write the syntax and purpose of a switch statement in C.

0 Answers   Adobe,


what is pointer ? what is the use of pointer?

6 Answers   Infosys,


What is the symbol indicated the c-preprocessor?

0 Answers  


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

1 Answers  






What is hash table in c?

0 Answers  


How to write in a function declaration and in function call in which the function has 'n' number of varible or arguments?

2 Answers  


How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal)

1 Answers   iLantus, Subex,


Describe wild pointers in c?

0 Answers  


What is the collection of communication lines and routers called?

0 Answers  


How can you find the exact size of a data type in c?

0 Answers  


What are different types of pointers?

0 Answers  


Categories