Challenge: Signal
Uppgift
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.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 2. Kapitel 3
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 6.25
Challenge: Signal
Svep för att visa menyn
Uppgift
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.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 2. Kapitel 3
single