Skip to main content
Became Hot Network Question
Formatted code
Source Link
MarcoB
  • 67.7k
  • 18
  • 96
  • 198

With the following code I produce the binary digits of n=13:

n=13;

Q = Quotient[n, 2];

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

n=13;

Q = Quotient[n, 2]; 

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

The problem is that it outputs the digits

  as

1

0

1

1

1

0

1

1

but I want 'emthem to appear horizontally

1101 1101.

  What is the most direct way to produce the desired effect regardingregarding the output's style?

Thanks in advance for your help.

With the following code I produce the binary digits of n=13:

n=13;

Q = Quotient[n, 2];

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

The problem is that it outputs the digits

  as

1

0

1

1

but I want 'em to appear horizontally

1101.

  What is the most direct way to produce the desired effect regarding the output's style?

Thanks in advance for your help.

With the following code I produce the binary digits of n=13:

n=13;

Q = Quotient[n, 2]; 

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

The problem is that it outputs the digits as

1

0

1

1

but I want them to appear horizontally 1101. What is the most direct way to produce the desired effect regarding the output's style?

added 33 characters in body
Source Link
Jamai-Con
  • 163
  • 1
  • 5

With the following code I produce the binary digits of n=13:

n=13;

Q = Quotient[n, 2];

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

The problem is that it outputs the digits

as

1

0

1

1

but I want 'em to appear horizontally

1101.

What is the most direct way to produce the desired effect regarding the output's style?

Thanks in advance for your help.

With the following code I produce the binary digits of n=13:

n=13;

Q = Quotient[n, 2];

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

The problem is that it outputs the digits

as

1

0

1

1

but I want 'em to appear horizontally

1101.

What is the most direct way to produce the desired effect?

Thanks in advance for your help.

With the following code I produce the binary digits of n=13:

n=13;

Q = Quotient[n, 2];

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

The problem is that it outputs the digits

as

1

0

1

1

but I want 'em to appear horizontally

1101.

What is the most direct way to produce the desired effect regarding the output's style?

Thanks in advance for your help.

edited body
Source Link
Jamai-Con
  • 163
  • 1
  • 5

With the following code I produce the binary digits of n=10n=13:

n=13;

Q = Quotient[n, 2];

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

The problem is that it outputs the digits

as

1

0

1

1

but I want 'em to appear horizontally

1101.

What is the most direct way to produce the desired effect?

Thanks in advance for your help.

With the following code I produce the binary digits of n=10:

n=13;

Q = Quotient[n, 2];

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

The problem is that it outputs the digits

as

1

0

1

1

but I want 'em to appear horizontally

1101.

What is the most direct way to produce the desired effect?

Thanks in advance for your help.

With the following code I produce the binary digits of n=13:

n=13;

Q = Quotient[n, 2];

While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]

The problem is that it outputs the digits

as

1

0

1

1

but I want 'em to appear horizontally

1101.

What is the most direct way to produce the desired effect?

Thanks in advance for your help.

Source Link
Jamai-Con
  • 163
  • 1
  • 5
Loading