Generation

generate functionWed, 30 Nov 2022

You are given a number in binary form. You have to print the number in decimal form after rightmost set bit

int num = 10101010; //Binary Number int lastSetBit = getLastSetBit(num); print(num & ~(1 << lastSetBit));

Questions about programming?Chat with your personal AI assistant