DEV Community

loading...

Discussion on: The Happy Number Problem

Collapse
haideralipunjabi profile image
Haider Ali Punjabi

Yeah I got that, but I don't see sum += n*n anywhere

Thread Thread
alisabaj profile image
Alisa Bajramovic Author

The line 'sum += e * e' is what sums the digits

Thread Thread
haideralipunjabi profile image
Haider Ali Punjabi

Ahh, I missed the while loop there. Oops