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 property type c?
What is the difference between array and pointer?
Can a program have multiple main() functions?
Write a program to use switch statement.
0 Answers Agilent, Integreon, ZS Associates,
What is dynamic dispatch in c++?
what are far pointers?
What are the different types of C instructions?
pierrot's divisor program using c or c++ code
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL
What is the size of structure in c?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
Write a c program to print the sizes and ranges of different data types in c?