Challenge: 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ää?
Kiitos palautteestasi!
Osio 2. Luku 3
single
Kysy tekoälyä
Kysy tekoälyä
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?
Mahtavaa!
Completion arvosana parantunut arvoon 6.25
Challenge: 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
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 2. Luku 3
single