Program to find the cube of the individual digits of a number.
__________________________________
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,cube,sum=0,rem;
cout<<"\nEnter the number: ";
cin>>a;
while(a>0)
{ rem=a%10;
cube=a*a*a;
sum+= cube;
a/=10;
}
cout<<"\nThe cube sum of individual digits is: "<<sum;
getch();
}
0 comments :