The idea is to check the 32 bits one by one from left to right. We will get final result after we finish that loop with 32 times. In each loop, we will always do 3 things:

- The final result multiply by 2
- If the modular of original value(n) is 1, then final result add 1.
- Make the original value divided by 2.

The code is as follow:

```
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t result = n%2;
n=n/2;
for(int i=0;i<31;i++)
{
result = result*2;
if(n%2==1)
result = result+1;
n=n/2;
}
return result;
}
};
```