
December 25th, 2012, 02:33 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 7
Time spent in forums: 2 h 57 m 24 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by requinix Third and fourth. Bits 2 and 3.
Take the number and bitwise-xor it with (1<<2 | 1<<3). Or alternatively xor it with 1<<2 then again with 1<<3. |
I've done that and it's still not working..
Code:
#include <stdio.h>
void main() {
int var = 0x0005;int new_var; int i=3,j=2;
new_var=(1<<i); new_var=(1<<j);
printf("The old number was: %d , and the new number is: %d \n",var,new_var);
getchar(); }
|