//find the sum of the series 1^3+2^3+3^3+...+n^3 number
#include <stdio.h >
int main (){
int n,i,cube ;
printf ("enter the value of n :");
scanf ("%i",&n);
for (i=1;i<=n;i++){
cube =cube + i*i*i;
}
printf ("the sum of cube of 1st n number is :%d",cube );
return 0;
}
No comments:
Post a Comment