Number 153 has 3 digits and if you take the 3rd power of every digit and calculate the sum of them, you will have the same number again. 153 = 13 + 53 + 33 = 1 + 125 + 27 = 153 Thus for 1634 you should take the fourth powers of every digit (because the number has 4 digits) and calculate the sum. How can I express this?? Please may you help me?? when i will insert INPUT 100-200 it should show 153. INPUT 1000-2000 >>>>show 1634
Code: . . . for(int i=1;i<=9;i++) for(int j=1;j<=9;j++) for(int k=1;k<=9;k++) { int sum=(i*i*i) + (j*j*j) + (k*k*k); if(sum/100==i && sum/10==j && sum%10==k) cout<< (i*i*i) + (j*j*j) + (k*k*k) <<" , "; } . . .