+ 3
How can we convert decimal numbers to binary in cpp
Number converter
8 Answers
+ 9
C++ have a special library for dealing with binary data called bitset.
I've written a code just for you! showing the memory usage differences
https://code.sololearn.com/coKLNTzAuZn1/?ref=app
+ 8
http://www.sanfoundry.com/cpp-program-decimal-binary-conversion/
+ 5
for example, you need to calculate binary of 5. In this case....
5/2=2, 5%2=1
2/2=1, 2%2=0
1/2=0, 1%2=1
so, binary of 5 is 101(the remainders from bottom to top)
in case of 6....
6/2=3, 6%2=0
3/2=1, 3%2=1
1/2=0, 1%2=1
so binary of 6 is 110
+ 3
I made the program in javascript...
https://code.sololearn.com/WBU6UjIarh7S/?ref=app
It may help you to write the program in c++..
http://www.sanfoundry.com/cpp-program-decimal-binary-conversion/
+ 1
@ MD. NAFIS UL HAQUE SHIFAT how can u do that in cpp?
+ 1
Thank u so much đđđ
0
Ty all