Похожие чаты

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 ответов

28 просмотров

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?

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

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

Добрый день. Хочу сделать отрисовку по команде на панели. Почему-то рисуется только при втором вызове. С чем может быть связано, не подскажете? procedure TForm1.FormDblClick(...
Kirill Filippenok
20
а зачем этот вопрос для удаления из чата?
Mёdkinson Medvezhkin
63
using next image component with s3 image: "url" parameter is valid but upstream response is invalid code: <Image fill src={s...
Fasil
3
Эх кто-то пришел и весь праздник испортил :( You need complex FBX scene importing setup to change things on import? good luck with that. You need navigation and pathfinding? g...
Serg Gini
5
Всем привет! Нужен совет от опытных. Переношу свой проект с Делфи 10.2 Токио на Лазарус 3.2 установленный через инсталлятор fpcupdeluxe-x86_64-win64. При импортировании проект...
Дмитрий Завгородний
2
Friends, how can I find my Wazirx wallet address?
Silm Silm
31
Всем привет! Подскажите. Я написал приложение на Delphi 10.2 Tokyo под Windows 10. И передо мной стал вопрос о том чтобы сделать это приложение кроссплатформенным (под Linux и...
Дмитрий Завгородний
24
Какого хера? /Sources/App/Modules/User/Models/UserLinkApple.swift:21:20: warning: stored property '_id' of 'Sendable'-conforming class 'UserLinkApple' is mutable @ID(...
Alexander Sherbakov
14
My 7 year old daughter recognizes the Bitcoin symbol and knows it's currency. What are the top ,3-5 most basic important concepts to convey to a kid about BCH? I started with ...
Big Hair
24
How the price of ANVL is decided? The buying pressure comes just from staking which is very slow, while the selling pressure might be huge. What are the benefits for those who...
MJ Javvaji @muralijavvaji
13
Карта сайта