Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. void printBinary (char c)
  2. {
  3. int OuterResults = 0;
  4. while(c > 0)
  5. {
  6. int innerResults = 1;
  7. int i;
  8. for(i = 2; i <= c; i *= 2)
  9. {
  10. innerResults *= 10;
  11. }
  12. c -= i / 2;
  13. OuterResults += innerResults;
  14. }
  15.  
  16. printf("%i\n",OuterResults);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement