The point is it can be any number. I just use one of the them, to show the example. Please you have another idea how can i fix my program.

I know that. I give also an example based on your example. So you need to know the number of bits of the number that the user enters. Another way to do this is with string manipulation, take the input of the user as a string then just replace the 0s with 1s and the 1s with 0s.

The point is it can be any number. I just use one of the them, to show the example. Please you have another idea how can i fix my program.

I know that. I give also an example based on your example. So you need to know the number of bits of the number that the user enters. Another way to do this is with string manipulation, take the input of the user as a string then just replace the 0s with 1s and the 1s with 0s.

That what I am trying to do with my swtich loop, but it doesn't working. If ti si posible can you show me a example that how can I fix my switch loop that it can work.

Re: binary number progblem

Posted 02 October 2007 - 07:08 AM

You have to be patient, this is a forum not live chat, that means you may get answer sooner or later or maybe you wont get one at all. Instead of the time waiting for someone to reply, try solving this yourself.