base conversion

Home Forums C Programming base conversion

This topic contains 2 replies, has 3 voices, and was last updated by  Priyansh Agrawal 10 years, 1 month ago.

  • Author
  • #2024


    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.

  • #3264


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

  • #3265

    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:

You must be logged in to reply to this topic.