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

How many types of sorting are there in c?

1 Answers  


What is keyword in c?

1 Answers  


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1 Answers   TCS,


Explain the use of keyword 'register' with respect to variables.

1 Answers  


f() { int a=2; f1(a++); } f1(int c) { printf("%d", c); } c=?

7 Answers   Geometric Software,


wat are the two methods for swapping two numbers without using temp variable??

2 Answers  


What is getche() function?

1 Answers  


How Many Header Files in c?

2 Answers   TCS,


Explain what’s a signal? Explain what do I use signals for?

1 Answers  


What are the types of data files?

1 Answers  


Write code for finding depth of tree

2 Answers   Adobe,


How can I call fortran?

1 Answers  


Categories