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
Is main is user defined function?
What are types of structure?
What is the difference between c &c++?
What is volatile variable in c with example?
Is main an identifier in c?
Describe the modifier in c?
What is fflush() function?
in iso what are the common technological language?
What is meant by int main ()?
What is array of structure in c programming?
What is the difference between text files and binary files?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
Who is the founder of c language?
What is c definition?
Which is an example of a structural homology?