Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added code for Number Conversion #7781

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ansh-Vikalp
Copy link

Problem

The issue being addressed is the lack of a straightforward tool for converting decimal numbers into hexadecimal, binary, and octal formats. This makes it difficult for users to quickly switch between number systems without performing manual calculations or relying on complex tools.

Solution

The implemented solution is a simple program that allows users to input a decimal number and instantly converts it to hexadecimal, binary, and octal formats, making the process seamless and efficient.

Fix for issue #7780

Test Case 1:
Input: 10
Expected Output:

Hexadecimal: A
Binary: 1010
Octal: 12
Test Case 2:
Input: 255
Expected Output:

Hexadecimal: FF
Binary: 11111111
Octal: 377

Changes Proposed

  • 1. Created functions for converting decimal numbers to hex, binary, and octal.
  • 2. Added an interface for user input and output display.
  • 3. Improved code readability and organized structure for future scalability.

@Ansh-Vikalp
Copy link
Author

@Ansh-Vikalp Please Star ⭐️ the repo to earn 'hacktober-accepted' label for the event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant