Skip to content

Instantly share code, notes, and snippets.

View yotam5's full-sized avatar

Yotam yotam5

View GitHub Profile
@yotam5
yotam5 / reverse binary simplified
Created November 20, 2021 16:05
reverse binary simply
#include <iostream>
#include <bitset>
//reverse binary of a number
unsigned int flipping2(unsigned int a)
{
//input: 0000010110
//output:0000001101
unsigned int f = 0x0;
unsigned int size = sizeof(a) * 8;