Base Conversion And Then Reversing The Result

Hi there can someone please help !! i would really love some help

i need to write a program that takes a decimal number from the command line and converts this number in REVERSE order into the base specified by the last parameter. The program should perform error checking.

Eg 12 b2
which should return the number '12' displayed as a binary number
in REVERSE order i.e as 0011
Please note that the first two zeros are NOT leading zeros, they are part
of the number in REVERSE format: In other words: the binary value of 12
is 1100 the reverse of this is: 0011.

Anyone able to write me a code plz??
Last edited on
Anyone able to write me a code plz??

This isn't a site where others will do your homework for you. However, if you write your own code and encounter problems with it, please post what you have done and someone will be able to help with that.

As for the question it comes in two parts.
1.
a) Get the input from the command line
b) validate the input and either continue or give a useful error message.

2. Convert the number to the given base and output it.

I haven't mentioned reversing the converted output. That's because one of the common and simple ways of converting to another base (using the integer % and / operations) will naturally output the digits in reverse order, thus consider it a bonus that outputting in reverse is actually easier.

So my question now is - which of these parts of the code have you attempted so far, and where is your code, and what problems do you have with it?
Topic archived. No new replies allowed.