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 is the basis for selection of arrays or pointers as data structure in a program
What should be keep precautions while using the recursion method?
main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
develop algorithms to add polynomials (i) in one variable
which type of question asked from c / c++ in interview.
helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe
m=++i&&++j(||)k++ printf("%d"i,j,k,m)
Output for following program using for loop only * * * * * * * * * * * * * * *
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
How can I prevent another program from modifying part of a file that I am modifying?
which types of data structure will i use to convert infix to post fix???