Decimal to Binary | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Decimal to Binary

I want to write a program in C to convert Decimal to Binary. Is there any hint? All help is appreciated. Thanks.

5th May 2021, 9:24 AM
Nguyễn Vĩnh HẢO
Nguyễn Vĩnh HẢO - avatar
5 Answers
+ 3
What do you mean any hint? If you know how to convert on paper it should be fairly easy to code
5th May 2021, 9:43 AM
Slick
Slick - avatar
+ 2
Duy Khuong 1.Store the remainder when the number is divided by 2 in an array. 2.Divide the number by 2 3.Repeat the above two steps until the number is greater than zero. 4.Print the array in reverse order now.
5th May 2021, 9:45 AM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar
+ 1
For more hints post your code
5th May 2021, 10:56 AM
Atul [Inactive]
0
Well thanks you all guys, just figured it out while offline. Many thanks <3 <3
5th May 2021, 10:33 AM
Nguyễn Vĩnh HẢO
Nguyễn Vĩnh HẢO - avatar
0
You can search in the codeplay section
5th May 2021, 10:42 AM
Aditya
Aditya - avatar