Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

Please teach me some ways on how to convert an integer to a binary digits. thanks.

OpenStudy (anonymous):

Well, show us what you've got so far.

OpenStudy (rsmith6559):

This function, with base 2, will do it. It just needs a main() written for it. #include <stdio.h> #include <stdlib.h> int mkDigit( int number, int base, char* answer ) { char characters[] = { "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" }; int remainder, index; if( number == 0 ) return( 0 ); remainder = number % base; number /= base; index = mkDigit( number, base, answer ); answer[ index ] = characters[ remainder ]; return( ++index ); }

OpenStudy (anonymous):

i don't think he asked for a program just google how to convert decimal to binary

OpenStudy (rsmith6559):

True, but the algorithm still shows.

OpenStudy (anonymous):

tell != teach

OpenStudy (farmdawgnation):

I agree with @nczempin above, personally. Please do note we have a new clause in our Code of Conduct that reads "Don’t post only answers - guide the asker to a solution."

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
LILBOY: is love a great thing or not?
4 hours ago 3 Replies 1 Medal
Tryce: can anyone rate my drawing??
10 seconds ago 16 Replies 4 Medals
ykbatman: who knows how to code a script?
7 hours ago 24 Replies 0 Medals
Gdub08: which function represents the data in the table
14 hours ago 1 Reply 0 Medals
Nininiko: Someone give me cute comic book ships to draw.ud83dudc8b
8 hours ago 10 Replies 1 Medal
MAGABACK: What is the purpose of prescription sunglasses?
15 hours ago 0 Replies 0 Medals
emmamyersglazer: does anyone like the outsiders?
9 hours ago 19 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!