60 537
Assignments Done
97,9%
Successfully Done
In April 2018

Answer to Question #24994 in C++ for pascal

Question #24994
between 100 and 999,there are some numbers that has certain characteristics that if you cube the individual digits and sum together you should get the same number
Expert's answer
# include <iostream>
using namespace std;



int main(){
/*between 100 and 999,there are some numbers that has certain characteristics
that if you cube the individual digits and sum together you should get the
same number*/



for (int num=100;num<999;num++){

int temp=num;
int s=0;
while (temp>=1){

s+=(temp%10)*(temp%10)*(temp%10);
temp/=10;
}
if (s==num) cout<<num<<"& ";
}

system("PAUSE");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions