Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Qbasic Program help

I need a program to convert from decimal to octal and back

Do I need to combine a decimal to binary to get to the

octal conversion or is there an easier way?


thanks

for any help





Comments

  • : I need a program to convert from decimal to octal and back

    : Do I need to combine a decimal to binary to get to the

    : octal conversion or is there an easier way?


    : thanks

    : for any help


    You must do a integer division by 8 and remember the rest. Then you have to do it newly until the rest < 8.

    After it you must to take all the rest in reverse mode.

    Example:

    134/8

    6 16/8

    0 2


    134(10 = 206(8


  • : I need a program to convert from decimal to octal and back

    : Do I need to combine a decimal to binary to get to the

    : octal conversion or is there an easier way?


    : thanks

    : for any help


    You must do a integer division by 8 and remember the rest. Then you have to do it newly until the rest < 8.

    After it you must take all the rest in reverse mode.

    Example:

    134/8

    ..6 16/8

    .....0 2


    134(10 = 206(8


Sign In or Register to comment.