i have been given a series and ihave to find its sum.
i'm just a beginner so pleese keep ur program simple;

series is like this;
2^2 + ( 2^2+ 4^4) + (2^2 + 4^4 + 6^6)....
take in number of terms from user.

7
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by prvnkmr449

Please don't shout - it hurts our ears. :(

Nobody will do the assignment for you. Attempt it yourself, and if you still require help, paste what you have so far here.

Edited by Akill10: n/a

i wanna enrol for programming but not sure which one should i take... pls give me some opinion guys

Use this may it will help but mind data type before entering the number of term

2^2+(2^2+4^4)+(2^2+4^4+6^6)+....

``````#include<conio.h>
#include<iostream.h>
#include<math.h>
void main()
{
clrscr();
int n,t=2;
long int total=0,subtotal;
cout<<"Enter term :";
cin>>n;
cout<<"\n\t";
for(int i=0;i<n;i++)
{
cout<<"(";
for(int j=0;j<=i;j++)
{
subtotal=pow((j+1)*2,(j+1)*2);
cout<<(j+1)*2<<"^"<<(j+1)*2;
if(j<i)
cout<<"+";
}
total+=subtotal;
cout<<")";
if(i<n-1)
cout<<"+";
}
cout<<"\n\n\t"<<total;
getch();
}``````

Best Of Luck.

@prvnkmr449:

I've seen a few posts from you now and I get the idea that you don't know that you're writing non-standard code. The program above will run perfectly fine on TurboC, but on any other compiler from the last five-ten years it won't compile. It's time to update to something from this millennium, like Visual Studio 2010 Express, or Code::Blocks.
Also, we don't give away free homework to people who show no effort. It's in the rules. We encourage people to help others, but you can if you hand out complete codes, the poster will just copy-paste it and turn it in without knowing how the program works, why it should be written this way or how to make it themselves. The next assignment will be of a higher level and since the poster didn't learn anything they'll be back for more free homework.

Also: having your email and phonenumber in you signature on a public forum will result in *a lot* of spam. You should think about removing them :icon_wink:

Edited by Nick Evan: n/a

Hi Nick Evan,
Ya some thing is true in your post is that I write code which perfectly work and compile on TurboC, region behind that is I use TurboC only , although I have Visual Studio 2005 but I don't know how to compile and write c or c++ coding on that, If possible please help me.I got the -ve marks for that also.
Thank You

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.