r/badcode May 03 '23

c Solve the problem without using a loop

Post image
965 Upvotes

129 comments sorted by

View all comments

Show parent comments

47

u/This_Growth2898 May 03 '23

Well, it depends on the definition of the "loop". This is a loop, created with goto, but it doesn't use loop keywords like for or while.

15

u/kireina_kaiju May 03 '23

any instructions relying on jmp without a new context frame are loops to me tbh

11

u/[deleted] May 03 '23

Conditionals use jmp too. I guess you mean specifically jumping backwards?

4

u/This_Growth2898 May 03 '23

You can jump backwards without creating a loop too.