Post History
Challenge Write a program that takes in a number greater than or equal to 0 and outputs its representation in hexadecimal (base 16). Examples 0 => 0 1 => 1 10 => A 15 ...
#3: Post edited
- ## Challenge
Write a program that takes in a number in base 10 and outputs its representation in [hexadecimal (base 16)](https://en.wikipedia.org/wiki/Hexadecimal).- ---
- ## Examples
- ```none
- 0 => 0
- 1 => 1
- 10 => A
- 15 => F
- 16 => 10
- 107 => 6B
- 153 => 99
- 207 => CF
- 1000 => 3E8
- 10381 => 288D
- 48821 => BEB5
- ```
- ---
- ## Rules
- * No built-in hexadecimal functions.
- * More generally, any base conversion function is considered to be disallowed.
- * Letters can be uppercase or lowercase.
- * It should work at least for all inputs greater than 0 up to the language's default type limit.
- * Leading zeros in the output is fine. (i.e. `000003E8` for 32-bit numbers)
- * This is [code-golf], so shortest code wins.
- ## Challenge
- Write a program that takes in a number greater than or equal to 0 and outputs its representation in [hexadecimal (base 16)](https://en.wikipedia.org/wiki/Hexadecimal).
- ---
- ## Examples
- ```none
- 0 => 0
- 1 => 1
- 10 => A
- 15 => F
- 16 => 10
- 107 => 6B
- 153 => 99
- 207 => CF
- 1000 => 3E8
- 10381 => 288D
- 48821 => BEB5
- ```
- ---
- ## Rules
- * No built-in hexadecimal functions.
- * More generally, any base conversion function is considered to be disallowed.
- * Letters can be uppercase or lowercase.
- * It should work at least for all inputs greater than 0 up to the language's default type limit.
- * Leading zeros in the output is fine. (i.e. `000003E8` for 32-bit numbers)
- * This is [code-golf], so shortest code wins.
#2: Post edited
- ## Challenge
- Write a program that takes in a number in base 10 and outputs its representation in [hexadecimal (base 16)](https://en.wikipedia.org/wiki/Hexadecimal).
- ---
- ## Examples
- ```none
- 0 => 0
- 1 => 1
- 10 => A
- 15 => F
- 16 => 10
- 107 => 6B
- 153 => 99
- 207 => CF
- 1000 => 3E8
- 10381 => 288D
- 48821 => BEB5
- ```
- ---
- ## Rules
- * No built-in hexadecimal functions.
- * Letters can be uppercase or lowercase.
- * It should work at least for all inputs greater than 0 up to the language's default type limit.
- * Leading zeros in the output is fine. (i.e. `000003E8` for 32-bit numbers)
- * This is [code-golf], so shortest code wins.
- ## Challenge
- Write a program that takes in a number in base 10 and outputs its representation in [hexadecimal (base 16)](https://en.wikipedia.org/wiki/Hexadecimal).
- ---
- ## Examples
- ```none
- 0 => 0
- 1 => 1
- 10 => A
- 15 => F
- 16 => 10
- 107 => 6B
- 153 => 99
- 207 => CF
- 1000 => 3E8
- 10381 => 288D
- 48821 => BEB5
- ```
- ---
- ## Rules
- * No built-in hexadecimal functions.
- * More generally, any base conversion function is considered to be disallowed.
- * Letters can be uppercase or lowercase.
- * It should work at least for all inputs greater than 0 up to the language's default type limit.
- * Leading zeros in the output is fine. (i.e. `000003E8` for 32-bit numbers)
- * This is [code-golf], so shortest code wins.
#1: Initial revision
Convert to Hexadecimal
## Challenge Write a program that takes in a number in base 10 and outputs its representation in [hexadecimal (base 16)](https://en.wikipedia.org/wiki/Hexadecimal). --- ## Examples ```none 0 => 0 1 => 1 10 => A 15 => F 16 => 10 107 => 6B 153 => 99 207 => CF 1000 => 3E8 10381 => 288D 48821 => BEB5 ``` --- ## Rules * No built-in hexadecimal functions. * Letters can be uppercase or lowercase. * It should work at least for all inputs greater than 0 up to the language's default type limit. * Leading zeros in the output is fine. (i.e. `000003E8` for 32-bit numbers) * This is [code-golf], so shortest code wins.