Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void bin(int N){
- unsigned int M = 1 << (sizeof(int) * 8 -1); // Legnagyobb helyiértékű bitre van állítva a maszk
- while (M != 0){
- printf ("%d", (N&M)==0?0:1);
- M >>= 1; // M = M >> 1;
- }
- printf ("\n");
- }
- int main(){
- int a = -5;
- bin(a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement