Star Trek Website
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Ategon@programming.dev to Programmer Humor@programming.dev · 3 years ago

How to detect if a number is even

programming.dev

message-square
18
link
fedilink
30

How to detect if a number is even

programming.dev

Ategon@programming.dev to Programmer Humor@programming.dev · 3 years ago
message-square
18
link
fedilink
  • jeff 👨‍💻@programming.dev
    link
    fedilink
    arrow-up
    4
    ·
    3 years ago
    bool isEven(int num) {
       return !isOdd(num);
    }
    
    bool isOdd(int num) {
       return !isEven(num);
    }
    
    • Spy@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      Legends say this code runs faster than what the op posted. StackOverflow Errors are surprisingly fast in most languages

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 57 users / day
  • 2.41K users / week
  • 6.26K users / month
  • 15.1K users / 6 months
  • 100 local subscribers
  • 33.3K subscribers
  • 2.5K Posts
  • 95.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.20
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org