Write a C program for finding the addition of the cube values of “n” digits using for loop statement.
[Useful: Education Loan Guide] & [Study Abroad Details]
PROGRAM IN C:
* Title: Cube value
Author: Vinoth Selvaraj
© http://students3k.com
*/
//Header files
# include <stdio.h>
# include <conio.h>
# include <math.h>
void main()
{
//Program variables
int j,num,su=0;
clrscr(); //function to clear previous output
printf("Enter the value:"); //Display function
scanf("%d",&num); //Getting input function
for(j=1;j<=num;j++) //looping statement
{
su+=pow(j,3);
}
printf("Sum of square = %d",su);
getch();
}