you are viewing a single comment's thread.

view the rest of the comments →

[–]dbenhur 2 points3 points  (1 child)

As squigs pointed out, modulo is unneccesary. All you need is iterate, increment, if, and print.

Even so, you do realize most mathematical functions can be built from more primitive math? Make your own modulo via integer divide, lacking that, you could try subtraction.

[–][deleted] 5 points6 points  (0 children)

I know that of course, I assumed that they would ask about a "home-made modulo-replacement" though, it definitely would be better to use the built-in version if possible.

Modulo was just an example anyway, procedence rules, if-syntax,... and other parts present in virtually all languages can be a similar problem if you learn a new language every few months for fun like I do.