C++ solution
Code


# Code
```cpp []
class Solution {
public:
    int smallestNumber(int n) {
        int x = 1;
        while (x <= n) {
            x <<= 1 ;
        }
        return x-1;
    }
};
```
['C++']