Ask your own question, for FREE!
Computer Science 11 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
laylasnii13: Who wanna write or make a song with me???
2 hours ago 0 Replies 0 Medals
kaelynw: art igg
59 minutes ago 9 Replies 1 Medal
XShawtyX: Art
19 hours ago 6 Replies 0 Medals
Nina001: teach me how to draw or just tell me the basics
21 hours ago 2 Replies 1 Medal
XShawtyX: We doing another drawing gimme ideas to add to this
22 hours ago 9 Replies 1 Medal
RAVEN69: What is x 3+y 3+z 3=k
1 day ago 20 Replies 1 Medal
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!