• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How do you convert from base-r to 10 to 6?

mOeeOm

Platinum Member
The code works fine now, but I need it to convert whatever the answer is to base 10 and then to base 6. How do you write this in C language? I know the math of it but can't put it in C language.

Any help would be appreciated.
 
Quotient Remainder Coefficient
129/8 = 16 1 1
16/8 = 2 0 0
2/8 = 0 2 2

129 from base 10 to base 8, how would you write this in C language for any number?
 
Didn't you learn how "%" works in the last assignment? does the number to the right of it have to always be a constant?

for base-r _to_ base-10 think about how you convert binary to decimal
 
Originally posted by: DaveSimmons
Didn't you learn how "%" works in the last assignment? does the number to the right of it have to always be a constant?

for base-r _to_ base-10 think about how you convert binary to decimal

Yes, I know you keep multiplying by the base, so if its (XYZ.W)r its = X x r^2 + Y x r^1 + Z x r^0 + W x r-1 and that gives me base 10, but I dont know how to write it in C language for any number and how to input it in the calculator program.
 
Back
Top