300.4 =(3x100) + (0x10) + (0x1) + (4x1/10)300 + 0 + 0 + 4/10
62 704 =(6x10 000) + (2x1000) + (7x100) + (0x10) + (4x1)60 000 + 2000 + 700 + 0 + 4
149 600 000 =(1x100 000 000) + (4x10 000 000) + (9x1 000 000) + (6x100 000) + (0x10 000) + (0x1000) + (0x100) + (0x10) + (0x1)100 000 000 + 40 000 000 + 9 000 000 + 600 000 + 0 + 0 + 0 + 0 + 0
906 =(9x100) + (0x10) + (6x1)900 + 0 + 6
705 =700 + 0 + 57(100) + 0(10) + 5(1)(7x100) + (0x10) + (5x1)
0x10=10 because your counting 10 0 times
main() { int num=0xABCD; printf("%x\n",num); int rev=0x0; int digit=0x0; while(num!=0x0) { digit=num%0x10; rev = rev*0x10 +digit; num=num/0x10; } printf("%x\n",rev); }
(6x10 0000+(0x1000)+(0x100)+(0x10)+(0x1)
300.4 =(3x100) + (0x10) + (0x1) + (4x1/10)300 + 0 + 0 + 4/10
600 090 000 =(6x100 000 000) + (0x10 000 000) + (0x1 000 000) + (0x100 000) + (9x10 000) + (0x1000) + (0x100) + (0x10) + (0x1)600 000 000 + 0 + 0 + 0 + 90 000 + 0 + 0 + 0 + 0
62 704 =(6x10 000) + (2x1000) + (7x100) + (0x10) + (4x1)60 000 + 2000 + 700 + 0 + 4
149 600 000 =(1x100 000 000) + (4x10 000 000) + (9x1 000 000) + (6x100 000) + (0x10 000) + (0x1000) + (0x100) + (0x10) + (0x1)100 000 000 + 40 000 000 + 9 000 000 + 600 000 + 0 + 0 + 0 + 0 + 0
906 =(9x100) + (0x10) + (6x1)900 + 0 + 6
705 =700 + 0 + 57(100) + 0(10) + 5(1)(7x100) + (0x10) + (5x1)
703 =700 + 0 + 37(100) + 0(10) + 3(1)(7x100) + (0x10) + (3x1)Alternatively, you can leave out the placeholders (0, zeros)
106.790 =(1x100) + (0x10) + (6x1) + (7x1/10) + (9x1/100)100 + 0 + 6 + 7/10 + 9/100
1300 =1000 + 300 + 0 + 01(1000) + 3(100) + 0 + 0(1x1000) + (3x100) + (0x10) + (0x1)Alternatively, you can leave out the placeholders/zeroes (0)