Write a program for the following series:
1*3*5-2*4*6+3*5*7-4*6*8+.................up to nterms
Answer Posted / y hussain reddy
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int i,p,n;
long s=0;
puts("nter n\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{p=pow(-1,i-1);
s+=i*(i+2)*(i+4)*p;
}
printf("ans=%ld",s);
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is return in c programming?
c program to compute AREA under integral
Combinations of fibanocci prime series
How do you convert strings to numbers in C?
When is the “void” keyword used in a function?
What are all different types of pointers in c?
What are the types of c language?
Explain Basic concepts of C language?
Which is better oop or procedural?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
What is the explanation for prototype function in c?
Explain what are its uses in c programming?
What does 3 periods mean in texting?
what is the significance of static storage class specifier?
What is structure and union in c?