base conversion

Home Forums C Programming base conversion

Viewing 2 reply threads
  • Author
    Posts
    • #2024
      kenez
      Participant

      Guys I need to write a program that will convert FROM and TO any bases ranging from 2 to 10.oh bases meaning binary, base 3 numbers, octal etc(up to 10)

      The program should prompt for the base “converted to” and the base “converted from”.

      Can somebody tell me how I need to go about this and what aspects of C
      maybe helpful. I will do the actual coding and report any problems.
      Thanks

    • #3264
      Anonymous
      Inactive

      A program to convert a decimal number to its equivalent binary number.

    • #3265
      Priyansh Agrawal
      Participant

      This code could do this from base 2-10 to base 2-10. There is a nice function called itoa that converts int to char* and you can specify the base. Unfortunatelly the function atoi has no base-parameter. So I recoded it:

Viewing 2 reply threads
  • You must be logged in to reply to this topic.