Here is the code of the program to calculate the sum of the cube of the numbers up to nth terms
#include<stdio.h>
#include<stdio.h>
#include<math.h>
int n,j;
int sum=0;
printf("Enter
the value of n ");
scanf("%d",&n);
printf("Sum of
the series : ");
for(j=1;j<=n;j++)
{
{
if (j!= n)
printf("%d^3 + ",j);
else
printf("%d^3 = %d ",i,sum);
}
return 0;
}
0 Comments