Challenge: Signal
Tarefa
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.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 2. Capítulo 3
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Suggested prompts:
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Incrível!
Completion taxa melhorada para 6.25
Challenge: Signal
Deslize para mostrar o menu
Tarefa
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.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 2. Capítulo 3
single