C bit-shifting
Set bits, one at a time.\n\n# Code\nc []\nint smallestNumber(int n) {\n    int res = 0;\n\n    while (n > 0) {\n        res = (res << 1) | 1;\n        n >>= 1;\
Set bits, one at a time.\n\n# Code\n```c []\nint smallestNumber(int n) {\n    int res = 0;\n\n    while (n > 0) {\n        res = (res << 1) | 1;\n        n >>= 1;\n    }\n\n    return res;\n}\n```
['C']