Похожие чаты

Why 25? Write a function that converts a binary string to

a numeric value. That is, if you have
char * pbin = "01001001";
you can pass pbin as an argument to the function and have the function return an int
value of 25.

in this example pbin == 73
25 should be == 0001 1001

12 ответов

62 просмотра

You should make your assignments by yourself. Ask a question if you understand a concept not.

²- Автор вопроса
Sebastian Dicke
You should make your assignments by yourself. Ask ...

its question from book, and no its not mine homework

They made a mistake, I think. Can't see any way that could be 25

²- Автор вопроса

Language: js Code: const bin2dec = s => s.split('').map((c, i, arr) => (+(c === '1')) << (arr.length - i - 1)).reduce((a, b) => a + b, 0); console.log(bin2dec("01001001")); console.log(bin2dec("11001")); Output: 73 25

Sebastian Dicke
You should make your assignments by yourself. Ask ...

Is the above sufficiently obfuscated from plagiarism in C?

C primer sucks , use K&R

Vasili Koslov
C primer sucks , use K&R

What's bad about it? And what's good about K&R?

Chiyando
What's bad about it? And what's good about K&R?

it explains C so simple that even a toddler can learn to code

²- Автор вопроса

Does it work though?

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта