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 is 02d in c?

0 Answers  


Tell me is null always defined as 0(zero)?

0 Answers  


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

0 Answers  


What does printf does?

0 Answers  


Explain how do you search data in a data file using random access method?

0 Answers  






A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

0 Answers  


Differentiate between static and dynamic modeling.

0 Answers   Wipro,


what does keyword ‘extern’ mean in a function declaration?

1 Answers   Emerson,


Write a program of advanced Fibonacci series.

0 Answers   Aspiring Minds,


Write a function in c to find the area of a triangle whose length of three sides is given.

2 Answers  


What are the advantages of c preprocessor?

0 Answers  


write a program to print infinte number

4 Answers  


Categories