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
Are global variables static in c?
What are the advantages of using new operator as compared to the function malloc ()?
What is union and structure in c?
Explain goto?
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.
Describe the header file and its usage in c programming?
What is typeof in c?
what is the role you expect in software industry?
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
What is structure of c program?
What are different types of pointers?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
What is console in c language?
Explain bitwise shift operators?