- This topic has 1 reply, 2 voices, and was last updated 21 years, 9 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Archives › Computer Support › Computer Support Discussion › HELP: Programming in C!
I need to know how to make a base-5 calculator. In other words, a program in C that can calculate using number in base-5.
Or at least could someone teach me how to convert between bases in C.
Please Help.
Get the number
1)Divide it by the base u want to convert it to
2)Store the remainder
3)Store the quotient in the variable you initially got
4) Repeat the steps 1 and 2 till the conditon in Step 5 is reached
5) Check if the quotient is less than the base in this case 5, if so store the quotient in the variable where you store the remainder as the last value.
6)Reverse the variable where you have stored the remainder
7) Display the reversed variable, this will be the answer.
That is the logic, you can write the program now