Describe for loop and write a c program to sum the series
X + x2/2! + x3 /3! + …….. up to fifteen terms.
Answer Posted / 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 View All Answers
How can you find the day of the week given the date?
What are loops in c?
what is a function method?give example?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
What is the difference between fread and fwrite function?
What does sizeof function do?
What are comments and how do you insert it in a C program?
I have seen function declarations that look like this
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
How can I trap or ignore keyboard interrupts like control-c?
What is keyword in c?
Explain how can I convert a string to a number?
Why doesnt the call scanf work?
What are volatile variables in c?
write a program to copy the string using switch case?