# include <stdio.h> void Rec_Dec_To_Bin (int num); void main () { int num; int base; printf ("Enter the decimal number to convert it binary.\n"); scanf ("%d", &num); printf ("The number in decimal is : %d\n", num); printf ("\n"); printf ("The %d in binary is : ", num); Rec_Dec_To_Bin (num); printf ("\n\n"); } void Rec_Dec_To_Bin (int num) { if (((num / 2) != 0) && (num > 1)) { Rec_Dec_To_Bin ((num / 2)); } printf ("%d", (num % 2)); }
Chat with our AI personalities
Assuming you're converting from binary - that would be in 1024 decimal format.
ask mrs lane room 503 at cbhs periods 6-7
That question is defective, and it has no answer.' 125 ' is not a binary number.A binary number never has a digit bigger than ' 1 ' in it.
The answer depends on what you are converting from: binary, ternary, octal, hexadecimal ...
As compared to converting decimal into what other base! It is no more difficult to convert decimal into base 8 than decimal into binary or Hex.