Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - public static void printInvertedBits(int input) {
 - if (input < 0) return;
 - input = -input;
 - StringBuilder bits = new StringBuilder();
 - for (int i = 0; i < 32; i++) {
 - if ((i + 1) % 4 == 1) bits.insert(0, " ");
 - bits.insert(0, (input & 1));
 - input = input >> 1;
 - }
 - System.out.println(bits);
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment