summaryrefslogtreecommitdiff
path: root/progs/a694.py
blob: 5a670cea540d0bf4e285f491d850c946235a546e (plain)
1
2
3
4
5
6
7
8
def count_unset_bits(n): 
    count = 0
    x = 1
    while(x < n + 1): 
        if ((x & n) == 0): 
            count += 1
        x = x << 1
    return count