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
What is const volatile variable in c?
What is difference between far and near pointers?
Can true be a variable name in c?
How is a null pointer different from a dangling pointer?
What are the 4 types of organizational structures?
What are the ways to a null pointer can use in c programming language?
What is function and its example?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
Which node is more powerful and can handle local information processing or graphics processing?
What is union in c?
Why isnt there a numbered, multi-level break statement to break out
How do you determine a file’s attributes?
What does. int *x[](); means ?
What is memory leak in c?
Explain logical errors? Compare with syntax errors.