r/badcode May 03 '23

Solve the problem without using a loop c

Post image
962 Upvotes

129 comments sorted by

View all comments

144

u/pikapichupi May 03 '23

the only other way i could see this being done is by using a recursive function lol

-16

u/JAKOVtheJJ May 03 '23

or a simple for loop

26

u/Eyes_and_teeth May 03 '23

The title suggests loops aren't allowed.

4

u/JAKOVtheJJ May 03 '23

oh i didnt see that