idastan97

CSCI151 L18 P4

Oct 2nd, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.18 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. _Bool f=0;
  4.  
  5. void printBinary(int n){
  6.     if (n>0 || (!f)) {
  7.         f=1;
  8.         printBinary(n/2);
  9.         printf("%i", n%2);
  10.     }
  11.     return;
  12. }
  13.  
  14. int main(){
  15.     printBinary(96);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment