C Program To Find Sum Of Cubes Of N Numbers



#include <stdio.h>


#include <math.h>


int main ()


{


int i, n, sumcubes = 1;


printf("Enter n: \n");


scanf("%d", &n);


while (i <= n)


{


sumcubes += (i*i*i);


i++;


}


printf ("The sum of the cubes from 1 to %d is %d\n", n, sumcubes);


return 0;


}



OUTPUT
C Program to find sum of cubes of n numbers

Share To:

Arogya Thapa Magar

Post A Comment:

0 comments so far,add yours