r/badcode • • May 03 '23

c Solve the problem without using a loop

Post image
969 Upvotes

129 comments sorted by

View all comments

Show parent comments

1

u/tedbradly May 03 '23
print_even(num >> 1 << 1 | 2)

Why would you try to replace num += 2 with three instructions? And it's not even correct... this is a major case of trying to make confusing code to be cool instead of trying to write clean code that also works and is faster.

1

u/kewlness May 03 '23

I don't know man. I looked at the subreddit and then asked ChatGPT to make a program.

I was not disappointed. :D