int sum,temp,x,r,count=0; for(x=100;x<=200;x++) { temp=x; sum=0; while(x>0) { r=x%10; sum=sum+(r*r*r); x | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

int sum,temp,x,r,count=0; for(x=100;x<=200;x++) { temp=x; sum=0; while(x>0) { r=x%10; sum=sum+(r*r*r); x

I cant found error

17th Nov 2020, 5:18 PM
Muskan Lodhi
Muskan Lodhi - avatar
3 Respuestas
+ 4
Your code should be something like this: https://code.sololearn.com/cWG4a21pm22d/#c Next time please follow the guidelines: https://www.sololearn.com/post/75089/?ref=app Now can you please tell me what the code should do? You are getting two warning as you are not using the variable temp and count.
17th Nov 2020, 5:27 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 2
Yes share the full code please. Anyway it seems like you enter an infinite loop with the while
17th Nov 2020, 5:29 PM
Davide
Davide - avatar
+ 2
BEGGINER unless inside the while there is some instruction setting x to a value less than 1, it is an infinite loop
17th Nov 2020, 5:51 PM
Davide
Davide - avatar