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

Explain how many levels deep can include files be nested?

1028


Why c is known as a mother language?

1037


Write a program with dynamically allocation of variable.

1071


Explain how do you use a pointer to a function?

1056


writ a program to compare using strcmp VIVA and viva with its output.

1980


Why & is used in c?

1120


What is the code in while loop that returns the output of given code?

1900


Dont ansi function prototypes render lint obsolete?

1064


What is the purpose of scanf() and printf() functions?

1178


Why we use break in c?

937


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

3262


How can I sort a linked list?

977


shorting algorithmS

2198


Explain what is a pragma?

996


What is huge pointer in c?

1026