Skip to content

th0truth/numeral-system-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Numeral System Converter

A lightweight Numeral System Converter written in C that converts numbers from any base to any base. The project is designed to be simple, portable, and educational, demonstrating base conversion logic and modular C project structure.

Features

  • Convert numbers between arbitrary numeral bases

  • Supports common bases:

    • Binary (base 2)
    • Octal (base 8)
    • Decimal (base 10)
    • Hexadecimal (base 16)
  • Written in pure C

  • Modular project structure (Src, Inc, Build)

  • Simple Makefile-based build system

Project Structure

  .
  ├── Build /   # Build output (generated) 
  ├── Inc /     # Header files
  ├── Src /     # Source files
  ├── main.c
  ├── Makefile
  └── README.md

Build Requirements

  • GCC (or compatible C compiler)
  • GNU Make

Build Instructions

To compile the project, run:

make

This will:

  • Create the Build/ directory (if it does not exist)
  • Compile all .c source files
  • Generate the executable:
Build/main.o

Usage

After building, run the program with:

./Build/main.o

[number] [format]
  • number – The input number. Its base is automatically detected using common prefixes.
  • format – The desired output format.

Supported Input Formats

The base of the input number is determined as follows:

Prefix Base Example
0b Binary 0b1010
0x Hexadecimal 0x1F
0 Octal 075
none Decimal 42

Clean

To remove build files:

make clean

License

This project is provided for educational and personal use. You may modify and distribute it freely.

About

Convert number from any base to any base in C.

Topics

Resources

Stars

Watchers

Forks

Contributors