Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are derived data types in c?

1087


What is a null pointer in c?

1227


What is the difference between volatile and const volatile?

986


Explain what is the concatenation operator?

1167


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

1199


why do some people write if(0 == x) instead of if(x == 0)?

1073


C language questions for civil engineering

1719


How can I insert or delete a line (or record) in the middle of a file?

1016


What are different types of operators?

1042


What is a union?

1031


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1903


What is openmp in c?

1022


What is a function simple definition?

1093


Why do we use null pointer?

1062


What is union in c?

1115