322
you are viewing a single comment's thread
view the rest of the comments
[-] _thebrain_@sh.itjust.works 7 points 5 months ago

Not one person in the comments has attempted to answer any of the questions either.

[-] themusicman@lemmy.world 15 points 5 months ago

Haha good try. Hope your interview goes well

[-] basdiljhs@lemmy.world 14 points 5 months ago

for(var i=0;i<=100;i++){ if((i%2)==1) console.log(i); }

btw % is the modulo operator, x%y returns the remainder of division of x by y

[-] moog@lemm.ee 5 points 5 months ago

Thank you holy shit I was beginning to think no one has ever seen a fizz buzz before

[-] LostXOR@fedia.io 4 points 5 months ago

Slightly simpler, start at 1 and increment by 2 so you don't have to check whether i is odd.

for (var i = 1; i < 100; i += 2) {
  console.log(i);
}
[-] jeena@jemmy.jeena.net 3 points 5 months ago

Strictly speaking this one does not find the odd numbers, it just prints them.

[-] Goun@lemmy.ml 13 points 5 months ago

for (i%1=0; i+2; int) odd++; cout(3)

[-] Bolt@lemmy.world 1 points 5 months ago

(0..=100).filter(|n| n % 2 == 1).for_each(|n| println!("{n}"))

[-] ICastFist@programming.dev 1 points 5 months ago

Will you give me the position if I answer the problems? ๐Ÿ˜€

[-] _thebrain_@sh.itjust.works 1 points 5 months ago

Sure! I'll hire you without even answering the questions. Of course I'm not the op, I dont work in the it field (any more) and none of my open positions involve programming... But you have a job with my company whenever you need one.

this post was submitted on 14 Apr 2024
322 points (94.0% liked)

linuxmemes

20707 readers
1414 users here now

I use Arch btw


Sister communities:

Community rules

  1. Follow the site-wide rules and code of conduct
  2. Be civil
  3. Post Linux-related content
  4. No recent reposts

Please report posts and comments that break these rules!

founded 1 year ago
MODERATORS