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
a value that does not change during program execution a) variabe b) argument c) parameter d) none
Explain how can type-insensitive macros be created?
What does 4d mean in c?
What is the difference between the expression “++a” and “a++”?
Why do we use & in c?
What is difference between function overloading and operator overloading?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
Are enumerations really portable?
Explain how do you generate random numbers in c?
What does %c do in c?
What is the difference between new and malloc functions?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
What is huge pointer in c?
What is time complexity c?