Write a program to find sum of cubes of given 'n' numbers.

#include<stdio.h>
#include<conio.h>
  main()
{
  int i,n;

  int sum=0;

  clrscr();

  printf("\n enter the number n");

  scanf("\n %d",&n);

  sum=pow(((n*(n+1))/2,2);

  printf("\n sum of series=");

  for(i=1;i<=n;i++)

{

  if(i!=n)

{

  printf("%d^3+",i);

}

  else

{

  printf("%d^3=%d",i,sum);

}

  return (0);

}



output:-

  enter the number n=5

  sum of series=1^3+2^3+3^3+4^3+5^3=225