Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Signal | Bitwise Operators and Shifts
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Bitwise Operations and Binary Logic in C

bookChallenge: Signal

Tehtävä

Swipe to start coding

You are working with signal strength values and need to adjust them using bitwise operations. Implement two functions:

  • int increaseSignal(int value): increases the signal by shifting the value left by 1 bit;
  • int decreaseSignal(int value): decreases the signal by shifting the value right by 1 bit.

Follow these rules:

  • Use only the bitwise shift operators (<< and >>);
  • Do not use multiplication (*) or division (/);
  • Return the updated value from each function.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 3
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Signal

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

You are working with signal strength values and need to adjust them using bitwise operations. Implement two functions:

  • int increaseSignal(int value): increases the signal by shifting the value left by 1 bit;
  • int decreaseSignal(int value): decreases the signal by shifting the value right by 1 bit.

Follow these rules:

  • Use only the bitwise shift operators (<< and >>);
  • Do not use multiplication (*) or division (/);
  • Return the updated value from each function.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 3
single

single

some-alt