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 are 3 types of structures?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
Tell me about low level programming languages.
Create a simple code fragment that will swap the values of two variables num1 and num2.
What does the format %10.2 mean when included in a printf statement?
Is there a way to switch on strings?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
What is #include in c?
Why double pointer is used in c?
Multiply an Integer Number by 2 Without Using Multiplication Operator
Explain indirection?
Disadvantages of C language.
Tell me what are bitwise shift operators?
What is the basic structure of c?
How would you obtain the current time and difference between two times?