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

Are global variables static in c?

679


What are the advantages of using new operator as compared to the function malloc ()?

760


What is union and structure in c?

620


Explain goto?

720


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

2657






Describe the header file and its usage in c programming?

622


What is typeof in c?

611


what is the role you expect in software industry?

1660


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

643


What is structure of c program?

609


What are different types of pointers?

566


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

915


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

1895


What is console in c language?

613


Explain bitwise shift operators?

634