HEX - Editorial

Author: karn7

Practice

Contest

Difficulty

Cakewalk

PREREQUISITES

Simple Math

Problem
Given a decimal number, we have to find its corresponding Hexadecimal equivalent.

Explanation:

Question was simple, all you need to do is convert decimal number to hexadecimal.
It can be done by using arrays .All you need to do is store ASCII code of converted hexadecimal.
And then print in reverse order. For Example: 47 in the Decimal number system can be represented as 2F in the Hexadecimal number system.

See This

For those who don’t know array ,this can be done by storing ASCII code in one large no in 3 digit format (since highest value of ASCII code we need to save is 102 which is F) so that each 3 digit taken from right represent a ASCII value.

Setter Solution