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 / anshu porwal

#include<stdio.h>
#include<conio.h>
void main()
{
int x=1,y=3,z=5,n,cal,add=0,add1=0,total,i;
clrscr();
printf(" Enter Any Number to calculate Series for n
terms :");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
cal=(x*y*z);
x++;
y++;
z++;
if(i%2==1)
{
add=add+cal;
}
if(i%2==0)
{
add1=add1+cal;
}
}
total=add-add1;
printf(" Total Of Series Is %d",total);
getch();
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of gets and puts?

1094


Why doesnt long int work?

1101


How can I get random integers in a certain range?

1128


what value is returned to operating system after program execution?

2184


#include { printf("Hello"); } how compile time affects when we add additional header file .

1944


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

1193


Explain what is the use of a semicolon (;) at the end of every program statement?

1262


what is event driven software and what is procedural driven software?

2624


What is the maximum length of an identifier?

1232


What is chain pointer in c?

1117


How do I get an accurate error status return from system on ms-dos?

1181


What are pointers in C? Give an example where to illustrate their significance.

1277


what is uses of .net

1789


How will you delete a node in DLL?

1341


What is a stream water?

1285