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 / sanath

#include <iostream.h>

void main()
{
int nTerm;
int x=1,y=3,z=5,mul1,total=0;

cout<<"Enter the NTerm:";
cin>>nTerm;
for(int i=1;i<=nTerm;i++)
{
mul1 = ((x++)*(y++)*(z++));

if(i%2)
total = total + mul1;
else
total = total - mul1;

}
cout<<"RESULT:"<<total<<endl;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variable and explain rules to declare variable in c?

1089


What is the meaning of ?

1036


What is pointer in c?

1192


write a program to print data of 5 five students with structures?

2046


What is union in c?

1115


Is c is a procedural language?

1090


What is an expression?

1053


Write a program to find factorial of a number using recursive function.

1121


What is the sizeof () operator?

1081


what is the height of tree if leaf node is at level 3. please explain

2149


Give basis knowledge of web designing ...

2018


How to delete a node from linked list w/o using collectons?

2778


How can you return multiple values from a function?

1116


Is it possible to pass an entire structure to functions?

996


How do we open a binary file in Read/Write mode in C?

1240