Thursday, July 5, 2012

1^3 + 2^3 + 3^3 +.......+ n^3 = ?

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to find out the sum of a cube series. Take a look at the problem.

Problem: Evaluate the following series up to n.
                1^3 + 2^3 + 3^3 +...........


Sample Input:  5
sample Output:  225


Solution:


We know that, 1^3 + 2^3 + 3^3 +.......+ n^3 =  {n*(n+1)/2}^2.
Take a look at the program.


Thank you all...:)

0 comments:

Post a Comment