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


Please Help Members By Posting Answers For Below Questions

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

5188


Explain union. What are its advantages?

704


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

765


What is the use of getchar() function?

735


What is difference between array and structure in c?

671






Explain null pointer.

710


Write the test cases for checking a variable having value in range -10.0 to +10.0?

1936


What is the difference between array and linked list in c?

708


What is data type long in c?

724


What does c mean before a date?

715


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1554


Where define directive used?

693


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

715


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

878


Can you define which header file to include at compile time?

687