![]() |
sum of multiples - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Java, JVM, & JRE (https://sinister.ly/Forum-Java-JVM-JRE) +--- Thread: sum of multiples (/Thread-sum-of-multiples) |
sum of multiples - blackeagle - 09-22-2014 Find the sum of the multiples of 5 or 7 under 851 i know it's easy but i didn't sleep well yesterday and i'm eally not focued can't figure out what im doing wrong here here's my code help appreciated pls !! Spoiler: sum of multiples - blackeagle - 09-22-2014 Find the sum of the multiples of 5 or 7 under 851 i know it's easy but i didn't sleep well yesterday and i'm eally not focued can't figure out what im doing wrong here here's my code help appreciated pls !! Spoiler: RE: sum of multiples - dropzon3 - 09-22-2014 You're not tracking the sum anywhere? You are looking over the multiples of 5 and 7 with the i += 5 and i +=7 but the sum isn't being stored. You should do something like Code: do { similar code for the multiples of 7 RE: sum of multiples - dropzon3 - 09-22-2014 You're not tracking the sum anywhere? You are looking over the multiples of 5 and 7 with the i += 5 and i +=7 but the sum isn't being stored. You should do something like Code: do { similar code for the multiples of 7 RE: sum of multiples - blackeagle - 09-22-2014 omg i feel like an idiot now :/ thx for the help @"dropzon3" RE: sum of multiples - blackeagle - 09-22-2014 omg i feel like an idiot now :/ thx for the help @"dropzon3" |