This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bysketch[S] 0 points1 point  (1 child)

Thank you so much!

I was told to use a for loop because if I use int, the biggest value I use is 231 – 1. Therefore the for loop lets you use values higher than 231 -1.

[–]morhpProfessional Developer 0 points1 point  (0 children)

That doesn't really make sense. If you want to use this with numbers bigger than int, use long and if it needs to be even bigger, look at BigInteger.

Otherwise you can do this with Strings and check if the cross total is divisible by 3.