Write a program that reads a number and prints all of its binary digits: print the remainder
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a program that reads a number and prints all of its binary digits: print the remainder number %2, then replace the number with number /2. Keep going until the number is 0. For example, if the user provides the input 13, the output should be: 1
0
1
1
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: