Find the sum of numeric series of: ...........

Page 1 of 1

4 Replies - 341 Views - Last Post: 07 February 2018 - 06:17 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=409168&amp;s=0da7abfacc1ae9bc33671d03a837e604&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1 soul0h

Reputation: 0
• Posts: 4
• Joined: 07-February 18

Find the sum of numeric series of: ...........

Posted 07 February 2018 - 11:16 AM

Hey guys , so i have this homework for tomorrow to find the sum of numeric series of: "1/(2*3) + 4/(5*6) + 7/(8*9)............3*n-2 / (3n-1)*(3*n)"
I did this but im not sure if i have it done right or not , if its wrong please me another way of fixing it.
p.s dont get it too complicated im a begginer thanks

```[sub]#include <iostream>
using namespace std;
int main(){
double i,n,sum=0,k=2,l=3,h=1;
cout<<"Give the number n: \n";
cin>>n;
for (i=1;i<=(3*n-2)/(3*n-1)*(3*n);i++)
{
sum+=h/(k*i);
h=h+3;
k=k+3;
l=l+3;
}
cout<<"The sum of the numeric series is: "<<sum;
return 0;
}[/sub]
```

Is This A Good Question/Topic? 0

Replies To: Find the sum of numeric series of: ...........

#2 modi123_1

• Suitor #2

Reputation: 14045
• Posts: 56,201
• Joined: 12-June 08

Re: Find the sum of numeric series of: ...........

Posted 07 February 2018 - 11:39 AM

What happens when you run it? Does it match up what you have when you do it by hand?

#3 snoopy11

• Engineering ● Software

Reputation: 1460
• Posts: 4,726
• Joined: 20-March 10

Re: Find the sum of numeric series of: ...........

Posted 07 February 2018 - 12:54 PM

I'm afraid its not correct...

You are over complicating things the solution is actually much simpler than you have,
unfortunately this is a homework assignment so the help you will get from me will be sparing..

you have an equation which you have to sum for all "n" terms, actually think of what that means...

the general form of the equation is (3*n-2)/(3*n-1)*(3*n) for all n terms...

actually think how you could easily sum the equation for all n terms up.....

#4 CTphpnwb

• D.I.C Lover

Reputation: 3786
• Posts: 13,715
• Joined: 08-August 08

Re: Find the sum of numeric series of: ...........

Posted 07 February 2018 - 04:15 PM

If you were to use descriptive variable names you'd likely see the problems.

#5 tony jay

Reputation: 18
• Posts: 50
• Joined: 31-January 18

Re: Find the sum of numeric series of: ...........

Posted 07 February 2018 - 06:17 PM

snoopy11 has given you the essential key - solve the maths before you attempt the coding.
You need to generalise the equation - once you have done that, coding the thing will be relatively trivial.