Will somebody please help me solve this algorithm?

it says: 2+2x4+2x4x6+2x4x6x8+...+2x4x6x...x20

Recommended Answers

All 5 Replies

2 +
2x4 +
2x4x6 +
2x4x6x8 +

see the pattern? Exactly what help do you need?

in building the algorithm :/
e.g. sum=0
and i tried to continue that in different forms but it seems i can't solve that :/

You will need two nested loops
One to generate the lines like I split them up above, and an inner loop to to generate the 2x4x6... sequences

thanks for the help :) i did it :D


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.