Write a function with integer input which returns an integer having been flipped around in the binary sense. Example: Given 3, it should be turned into 0000 0011, then flipped 1100 0000, then return 64+128 = 192. I commented that this was easily done via bitwise manipulations, but I have not done those in a while so I wrote a program out in C to do it manually.
Anonymous
public int flipInteger (int n) { int i, newInt = 0; for (i = 0; i >= 1; } return newInt; }
Check out your Company Bowl for anonymous work chats.