It is very interesting topic. If we simple think, the process of conversion from decimal number to Octal number, then we can follow the below steps:
1. Let x = 15
2. r[0] = x%8 = 7
3. x = x/8 = 1
4. r[1] = x%8 = 1;
5. x = x/8 = 0
Terminate the algorithm, we find (15)10 = (17)8 [Note: reverse r]
But if we use bit-wise operator, then it makes more interesting and efficient.
1. Let x = 15
2. r[0] = x%8 = 7
3. x = x/8 = 1
4. r[1] = x%8 = 1;
5. x = x/8 = 0
Terminate the algorithm, we find (15)10 = (17)8 [Note: reverse r]
But if we use bit-wise operator, then it makes more interesting and efficient.

