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 volatile c?
Explain spaghetti programming?
Why doesnt long int work?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
Explain how do you determine a file’s attributes?
What does c mean before a date?
Explain what is #line used for?
What is the difference between call by value and call by reference in c?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
Can you mix old-style and new-style function syntax?
What is unary operator?
What are the two forms of #include directive?
What is #define?
What does node * mean?
What is the purpose of clrscr () printf () and getch ()?