Guest User

Untitled

a guest
Jun 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<math.h>
  4.  
  5. int bitsetq(int n, int b)
  6. {
  7. //function call to convert int b to it's 16-bit binary equivalent
  8.  
  9. [Type?] test = 0000 0000 0000 0001;
  10.  
  11. int twopow;
  12. twopow = pow(2, n); //2^n
  13.  
  14. test = test << n;
  15. b = b & test;
  16.  
  17. //function call to convert [type?] b to it's decimal equivalent.
  18.  
  19. if(b == twopow); {
  20. return 1;
  21. }
  22.  
  23. else {
  24. return 0;
  25. }
  26.  
  27. }
Add Comment
Please, Sign In to add comment