summaryrefslogtreecommitdiff
path: root/progs/a751.py
blob: 1f37c669c6c327a1af89b053b2fb71efea5dd2e6 (plain)
1
2
3
4
5
6
7
def highest_Power_of_2(n): 
    res = 0; 
    for i in range(n, 0, -1): 
        if ((i & (i - 1)) == 0): 
            res = i; 
            break; 
    return res;