A menu-driven C++ terminal application for number system conversions and bitwise operations. This project combines number representation, bit manipulation, and object-oriented programming concepts in one command-line tool.
Developed by Abhishek Kumar (@abhisheksinghcode)
Convert non-negative integers between different number systems.
- Decimal to Binary
- Binary to Decimal
- Decimal to Octal
- Decimal to Hexadecimal
- Hexadecimal to Decimal
- Binary to Octal
- Octal to Binary
- Binary to Hexadecimal
- Hexadecimal to Binary
- Octal to Hexadecimal
- General base conversion between bases 2 and 36
| Operation | Operator |
|---|---|
| Bitwise AND | & |
| Bitwise OR | ` |
| Bitwise XOR | ^ |
| Bitwise NOT | ~ |
| Bitwise NAND | ~(a & b) |
| Bitwise NOR | `~(a |
| Bitwise XNOR | ~(a ^ b) |
| Bitwise Implication | `(~a) |
| Left Shift | << |
| Right Shift | >> |
| Left Rotation | Bit rotation |
| Right Rotation | Bit rotation |
- Set a bit at a specified position
- Clear a bit at a specified position
- Toggle a bit at a specified position
- Check whether a bit is set
- Count the number of set bits
- Isolate the lowest set bit
- Remove the lowest set bit
- Check whether a number is a power of two
- Clear the lowest K bits
- Compare the most significant bits of two values
- Language: C++
- Standard: C++17
- Interface: Command-Line Interface (CLI)
- Compiler: GCC / MinGW-w64
- Libraries: C++ Standard Library
Before running the application, install:
- A C++ compiler that supports C++17
- GCC or MinGW-w64 on Windows
- A terminal or command prompt
Replace YOUR_REPOSITORY_NAME with your actual GitHub repository name.
git clone https://github.com/abhisheksinghcode/YOUR_REPOSITORY_NAME.gitcd YOUR_REPOSITORY_NAMEAssuming your source file is named main.cpp:
g++ -std=c++17 -Wall -Wextra -pedantic main.cpp -o mainWindows:
.\main.exeLinux / macOS:
./main===== NUMBER SYSTEM TOOLKIT =====
1. Number System Conversion
2. Basic Bitwise Operations
3. Bit Manipulation Operations
0. Exit
Enter choice:
Select a menu option to access the corresponding features. Choose 0 in a submenu to return to the main menu.
Input: 25
Output: 11001
Input: 255
Output: FF
Input: 11001
Output: 31
Input: 12 10
12 in binary: 1100
10 in binary: 1010
1100 & 1010 = 1000
Output: 8
Input: 15
Binary: 1111
Set bits: 4
number-system-toolkit/
├── main.cpp # Application source code
├── README.md # Project documentation
├── LICENSE # Optional license file
└── .gitignore # Optional Git ignore rules
This project helps strengthen understanding of:
- Number systems and base conversion algorithms
- Binary representation of integers
- Bitwise operators in C++
- Bit masking and bit manipulation
- Classes, objects, and encapsulation
- Menu-driven programming and switch statements
- Input validation and integer overflow handling
- Practical applications of bitwise operations in DSA
- Number system conversions support non-negative integers.
- Base conversion supports bases from 2 to 36.
- Bitwise operations use unsigned 32-bit integers.
- Fractional numbers and arbitrary-precision integers are not supported.
- Invalid digits and conversion overflow should be rejected.
- Support negative numbers and fractional conversions
- Add two's complement representation
- Implement arithmetic operations using bitwise operators
- Add automated unit tests
- Improve terminal formatting and error handling
- Separate the application into header and implementation files
Abhishek Kumar
- GitHub: @abhisheksinghcode
- Projects: View GitHub Repositories
Contributions, suggestions, and bug reports are welcome.
- Fork this repository.
- Create a new branch.
- Implement your changes.
- Test your code.
- Submit a pull request.
This project is available under the MIT License if distributed with an MIT LICENSE file.
If you find this project useful for learning C++ or bitwise operations, consider giving the repository a ⭐ star!