Hi ,
I am trying to explain the methods briefly.
first you take the decimal number and convert it to it's binary representation.
1)now to convert it to the Octal number
devide the binary
string in group of 3 bits from right and write
the octal equivalent for it.
for ex I have taken 19.
so the binary rep is-----
00010011(I am showing in a byte)
now from right u start grouping
00 010 011
avoid the left 2 zeros since it doesnt effect the magnitude.
so the octal equivalent is 023 (since the convention is to put a 0 before a octal literal)
2)for converting it to Hexadecimal follow the same way except yo devide the bits in a group of 4 and write the Hexadecimal equivalent for each group and then put a Ox before them to denote that it is a hexadecimal number.
so in the case of decimal 19?
0001 0011
the Hexadecimal equivalent is
0x13
-----------------------------------------------------------
thanks
Sathi