Thread: base 10 to base 2 conversion

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    2

    base 10 to base 2 conversion

    I am new to to C++ programming. I need a simple yes or no answer. Is it possible to write a prgram to convert any base 10 integer to a base 2 integer?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What do you think is the answer, and why?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    10
    Quote Originally Posted by dteum View Post
    I am new to to C++ programming. I need a simple yes or no answer. Is it possible to write a prgram to convert any base 10 integer to a base 2 integer?
    Off course yes! ..... There is hardly anything that you can't do while programming..... Just try it out once, using the basic concepts of the conversion ..... Ask if your not able to get it down correctly ......

  4. #4
    Registered User
    Join Date
    Sep 2008
    Posts
    2
    Thanks! I really wasn't sure. Hopefully this is the last question I ever ask.

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by gvkalra
    There is hardly anything that you can't do while programming.
    Could you please help me write a program that, given some arbitrary program and input for that program, will tell me if that program will stop executing eventually or run forever? Thanks

    Quote Originally Posted by dteum
    I really wasn't sure.
    Next time, try before you ask. At the moment you're relying on gvkalra's word alone. If gvkalra said no, would you believe it?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary to Base 10 decimal conversion
    By JFonseka in forum C Programming
    Replies: 13
    Last Post: 11-20-2007, 04:14 PM
  2. A-Star Pathfinding
    By mike_g in forum General AI Programming
    Replies: 1
    Last Post: 08-05-2007, 04:18 PM
  3. Header File Question(s)
    By AQWst in forum C++ Programming
    Replies: 10
    Last Post: 12-23-2004, 11:31 PM
  4. Base conversion problem!
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 10-08-2001, 07:00 PM
  5. Base Conversion
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 10-07-2001, 10:27 PM