To input a decimal number and display in hex, something like:
char buffer[99];
fgets(buffer, 98, stdin);
printf("%x", aoti(buffer));
would be the required core code. Needless to say, there is no error checking, mug trapping, etc. Or if you require the hex in a char[], then replace "printf(" by "sprintf(pointer_to_bufffer,"
221122: Binary = 1000100001000100100010 Octal = 10410442 Decimal = 2232610
10011101: Decimal = 157 Hexadecimal = 9D
Decimal: 170Hex: AA
Convert each group of 4 bits into one hexadecimal digit. 1010 is "A" in hexadecimal, so this particular number is "AA".
D = 13
pongada punda vayanungala ..................
This is not a question.
Write a program to convert a 2-digit BCD number into hexadecimal
WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL
224 = E0
NA
A45C: Decimal = 42076 Octal = 122134
BB895C: Octal = 56704534 Decimal = 12290396
221122: Binary = 1000100001000100100010 Octal = 10410442 Decimal = 2232610
BA = 11*16 + 10 = 176 + 10 = 186
Whether or not you can do that depends on the size of the number. If the number in question is greater than [decimal] 66535, then you cannot.
The way I convert between decimal and hexadecimal is to first convert the decimal number to binary: 664062510 = 110010101010011111100012 Then split the binary number into 16-bit (4 digit) chunks: 0110 0101 0101 0011 1111 00012 Next, convert each chunk into a hexadecimal digit: 0110 0101 0101 0011 1111 00012 6 5 5 3 F 1 Finally, put all the digits together: 664062510 = 6553F116