1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Oct 2012
Posts
2
Rep Power
0

#### Question need to solve about C++

Hello People this the first thread for me in this fourms I have a really hard Question about Algorthim I have to solve for the assignment so I wish to find the solve in this fourm the question is.

write an algorithm for a program that calculates the value of Z as follow:

Z = 1/1 - 1/4 - 1/16 - 1/64 - 1/256 - 1/1024

Note: you are required to use the loop structure.

So please anyone who now the answer or how to solve it to tell.
2. What do you notice about the progression 1, 4, 16, 64, 256, 1024?

Do you know what the next terms will be?

Can you write a for loop to print this progression?
3. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Oct 2012
Posts
2
Rep Power
0
I noticed that every number is divided by 4 but I dont know how how to write a loop to print print this progression could you give me a loop please :confused:
4. So for example,

denominator = 1;

Then in a loop
denominator = denominator * 4;

That's all I can say without giving you the chance to post some code of your own.

The whole problem is only like 5 lines of code, and saying anymore would just give the whole game away.
5. The series has a finite sum, which has an analytic answer. You should compare your sum with this.

http://www.intmath.com/series-binomial-theorem/3-infinite-geometric-series.php

Also, you'll get a more accurate answer from the sum if you sort the terms and add them from smallest magnitude toward largest magnitude.