Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<windows.h>
  3.  
  4.  
  5. void f(unsigned int n,int indexBit)
  6. {
  7. if (indexBit < 31)
  8. {
  9. indexBit++;
  10. f(n>>1,indexBit);
  11. }
  12. printf("%d", n&1);
  13. }
  14.  
  15. int main()
  16. {
  17. int d = 0, i = 0, n=32;
  18. scanf("%d", &d);
  19.  
  20.  
  21. f(d,0);
  22. /*for(i=0;i<n;i++)
  23. {
  24. printf("%d", d&1);
  25. d = d >> 1;
  26. }*/
  27.  
  28.  
  29.  
  30.  
  31. //f(0);
  32.  
  33. //signed int n = 0;
  34.  
  35. system("pause>0");
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement