C Program Cube Series
/* Write a program for following Series: 1^3 + 2^3 + 3^3 + 4^3 … + n^3 */
#include <stdio.h>
int main(void) {
int n;
printf("Enter Value of n :");
scanf("%d",&n);
printf(" Total Sum = %d",((n*(n+1))/2)*((n*(n+1))/2));
return 0;
}
#include <stdio.h>
int main(void) {
int n;
printf("Enter Value of n :");
scanf("%d",&n);
printf(" Total Sum = %d",((n*(n+1))/2)*((n*(n+1))/2));
return 0;
}
Comments
Post a Comment