Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Division by 3 using itoa() (http://www.go4expert.com/forums/division-3-using-itoa-t5316/)

kens 17Jul2007 22:06

Division by 3 using itoa()
WAP to divide a number by 3 using itoa() and without using /,% and *.

Please help me with this problem.

shabbir 18Jul2007 09:17

Re: Division by 3 using itoa()
I could not understand your problem and as far as I know itoa() converts integer to character?

kens 18Jul2007 13:24

Re: Division by 3 using itoa()
Can iota() be used to convert a number in base 10 to one in base 3 and then, if we could remove the last digit of the answer, that is 12 will be 110, remove last 0 ,making it 11.
Then, can we convert the result back to base 10 and display the answer?

Am I thinking in the right direction? If yes, is there an easy way to convert from base 3 back to base 10?

All times are GMT +5.5. The time now is 14:24.