```
uint32_t reverseBits(uint32_t n) {
uint32_t res;
if(n&1==0) res=0;
else res=1;
for(int i=1;i<32;i++){
res=(res<<1)|((n>>i)&1);
}
return res;
}
```

If I made some modification on the if statement, it is correct. Can anyone tell me why this happened? Thanks.

if(n&1==1) res=1;

else res=0;