r/shittyprogramming • • Sep 14 '18

Beginning in C++

I'm working in a small homework and the last step is calculate the least common multiple but with easy steps like if or something like that, could someone help me?

14 Upvotes

24 comments sorted by

View all comments

Show parent comment

2

u/FritangadeLuka420 Sep 14 '18

And without that statement? Or I can't without for?

4

u/bolche17 Sep 14 '18

It is impossible without a loop of some kind (while, for, recursion, etc). Unless you already know the maximum value of the factors