Skip to content

brk50/bitwise-c-programs

Repository files navigation

Bitwise C Programs - From Zero to Hero 🚀

Welcome to the ultimate bitwise playground! This repository contains a collection of C programs focused on bitwise operations — ideal for interview preparation and concept mastery.


💡 Motivation

I created this project not just to share bitwise interview questions, but as a way to deepen my own understanding by breaking down each concept into clean, executable C programs.

Bitwise operations often feel intimidating at first, but with hands-on examples and minimal, focused code, they become surprisingly intuitive.

This project is my learning playground — a space where I evolve from zero to hero in bitwise logic — and I hope it helps others do the same. Whether you're preparing for interviews or brushing up on fundamentals, you're welcome to learn alongside me.


📂 Project Structure

File Description
bitwise_playground.c Main menu-driven driver file
check_even_odd.c Check if a number is even or odd using bitwise &
swap_using_xor.c Swap two integers without using a temporary variable
count_set_bits.c Count number of set bits in an integer
check_power_of_two.c Check if a number is a power of 2 using (n & (n-1)) == 0
Toggle_kth_bit Toggle Kth bith in a given number

▶️ How to Compile and Run

compile and Run in Codespaces or Terminal:

make all
make run

Clean the build:

make clean

📚 Coming Soon

  • Clear ith bit
  • Reverse bits
  • Find non-repeating element using XOR
  • Add two numbers without + or -

Stay tuned and contribute if you’d like to collaborate!


📬 Feedback & Collaboration

Feel free to raise issues or submit pull requests. Let’s learn and grow together!

Run on Replit

Releases

No releases published

Packages

No packages published