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

a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

1095


What is array within structure?

1064


What does typedef struct mean?

1046


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

1097


Explain modulus operator.

1001


What are the types of bitwise operator?

1050


What is formal argument?

1094


Difference between linking and loading?

1065


What is the c value paradox and how is it explained?

994


What is c system32 taskhostw exe?

979


Which is better between malloc and calloc?

1122


Is fortran still used today?

1043


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

1069


What is the explanation for cyclic nature of data types in c?

1144


program to convert a integer to string in c language'

2400