SO basically what im trying to do is take an input number of any base and convert that number to any base(allowable bases 2,4,8,10,16). I am trying to think how i am supposed to go about coding it, wondering if anyone can point me into the right direction. Thanks

Recommended Answers

All 2 Replies

First create a skeleton, maybe something like this :

// include needed libraries
//...

int toDifferentBase(int number, int originalBase, int newBase){
  //code here
}

int main(){
  //test here
}

Now your problem now is to implement toDifferentBase.
The easiest way is to convert the input into base 10. Then convert
that base 10 number into newBase number.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.