Computer Science, asked by avinashmurmu99311, 1 year ago

WAP to input a number calculate and display the sum of the cube of digits​

Answers

Answered by arnabhsinha888
1

Answer:

this program is also known as armstrong number

for(i=n;i>0;i/=10)

{

d=i%10;

s=s+Math.pow(d,3);

}

Explanation:

This program is written in java where n is the number taken by the user nd s will be initialized as 0 nd d is the variable where the digits are stored

Similar questions