Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void printBinary (char c)
- {
- int OuterResults = 0;
- while(c > 0)
- {
- int innerResults = 1;
- int i;
- for(i = 2; i <= c; i *= 2)
- {
- innerResults *= 10;
- }
- c -= i / 2;
- OuterResults += innerResults;
- }
- printf("%i\n",OuterResults);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement