0

how do i

How do i select multiples of 3, 2, 5 etc... while in a "while" loop?

2nd Nov 2022, 12:39 AM
Evann Elmore
Evann Elmore - avatar
3 Answers
+ 4
Evann Elmore the modulo operator % comes in handy to solve that problem. For instance, if x%3 == 0 it tells you that x is a multiple of 3. In other words when the remainder of x/3 is zero it is a multiple of 3. Can you figure out the rest?
2nd Nov 2022, 12:48 AM
Brian
Brian - avatar
+ 3
Evann Elmore very well. If you get stuck, feel free to show what you have so far and ask for help. There are lots of friendly helpers here. Welcome to the Sololearn Community.
2nd Nov 2022, 1:06 AM
Brian
Brian - avatar
+ 2
yes, i think so, thank you. im new to coding
2nd Nov 2022, 12:58 AM
Evann Elmore
Evann Elmore - avatar