How i can find the the largest power of two less than a number without loop?

algorithm, c++

Solution

Assuming you want the largest power of two less than x, you get this from

Ans=pow(2,floor(log(x)/log(2)));

Problem

How i can find the largest power of two less than a number without loop ? Examples: ``` 5 output = 4. 11 output = 8. 100 output = 64. ```

Original source