Modulo operator Memes

Posts tagged with Modulo operator

I Just Made My First C Program :D

I Just Made My First C Program :D
Behold, the classic "I just learned programming" approach to checking if a number is even or odd! Instead of using the modulo operator ( n % 2 == 0 ), our brave beginner has hardcoded every possible case from 0 to 25. It's like building a dictionary to look up what 2+2 equals instead of just adding the numbers. This is the programming equivalent of bringing a printed map of every street in the country instead of using GPS. The best part? This code technically works... until someone enters 26.

Me Coding My First Project

Me Coding My First Project
Ah, the classic "checking if a number is even" function written by someone who clearly slept through the modulo operator lesson. Instead of the simple return number % 2 == 0 , this poor soul is writing out every possible case until they presumably die of old age around number 2,147,483,647. This is the programming equivalent of digging a tunnel with a spoon when there's a perfectly good excavator sitting right there. The desperate tweet above the code says it all - there IS an easier way, buddy. There always is.

Hip Hip Array! The Amazing Loop

Hip Hip Array! The Amazing Loop
Someone just wrote a Python loop that prints "hip hip" and "hooray" alternately and called it "amazing." That's the coding equivalent of discovering fire in 2023. The code increments a counter and checks if it's odd or even - printing "hip hip" for odd numbers and "hooray" for even ones. The real kicker? The variable 'n' isn't even initialized before they start adding to it. Absolute madlad behavior. Seven years of coding experience and I'm still waiting for my "amazing" badge for writing a basic if-else statement.