mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-13 21:42:29 +00:00
[PR #1524] [CLOSED] Added Binary to Gray code #2133
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/TheAlgorithms/C/pull/1524
Author: @Craniace
Created: 10/31/2025
Status: ❌ Closed
Base:
master← Head:master📝 Commits (2)
bf74ad3Create bonary_to_gray.c93858baRename bonary_to_gray.c to binary_to_gray.c📊 Changes
1 file changed (+55 additions, -0 deletions)
View changed files
➕
conversions/binary_to_gray.c(+55 -0)📄 Description
Description of Change
Added a new algorithm to convert a binary number to its Gray code equivalent in the bit_manipulation directory.
The algorithm performs bitwise XOR between the binary number and its right-shifted version to generate the Gray code.
References
Checklist
Notes:
Added
binary_to_gray.c— a simple and efficient implementation using bitwise operators with example and validation logic.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.