# C Program to Find Sum of Series 1^3 + 2^3 + 3^3 + … + n^3

This C Program calculates the Sum of Series 1^3 + 2^3 + 3^3 + … + n^3. Sum of the series 1^3 + 2^3 + 3^3 + … + n^3 = (n(n + 1) / 2)2

Here is source code of the C Program to Find the Sum of Series 1^3 + 2^3 + 3^3 + … + n^3. The C program is successfully compiled and run on a Linux system. The program output is also shown below.

1. `/*`
2. ` * C Program to Find the Sum of Series 1^3 + 2^3 + 3^3 + … + n^3`
3. ` */`
4. `#include <stdio.h>`
5. `#include <math.h>`
6. ` `
7. `int main()`
8. `{`
9. `    int number, i;`
10. `    int sum = 0;`
11. ` `
12. `    printf("Enter the maximum values of series n: ");`
13. `    scanf("%d", &number);`
14. `    sum = pow(((number * (number + 1) ) / 2),2);`
15. `    printf("Sum of the series : ");`
16. `    for (i = 1; i <= number; i++)`
17. `    {`
18. `        if (i != number)`
19. `            printf("%d^3 + ", i);`
20. `        else`
21. `            printf("%d^3 = %d ", i, sum);`
22. `    }`
23. `    return 0;`
24. `}`

```Output:
\$ cc pgm17.c
\$ a.out
Enter the maximum values of series n: 5
Sum of the series : 1^3 + 2^3 + 3^3 + 4^3 + 5^3 = 225```