1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Rama09 [41]
4 years ago
15

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
Computers and Technology
1 answer:
allsm [11]4 years ago
5 0
If you print the binary digits just like that, they'll be in the wrong order (lsb to msb). Below program uses recursion to print the digits msb to lsb. Just for fun.

void printBits(unsigned int n)
{
   if (n > 1) {
      printBits(n >> 1);
   }
   printf((n & 1) ? "1" : "0");
}

int main()
{
   unsigned int number;
   printf("Enter an integer number: ");
   scanf_s("%d", &number);
   printBits(number);
}

You might be interested in
In QBasic, create a number guessing challenge. Your program should generate a random number from 1-
Sergio039 [100]

Answer:

yes

Explanation:

6 0
3 years ago
What is the speed of Android operating system?
NemiM [27]

Answer:

There isn't an exact android speed due to a variety of androids. But there are very fast like the HTC 10 or a Samsung Galaxy.

Explanation:

6 0
3 years ago
Write a algorithm to attend birthday party​
kolezko [41]

Answer:

2     No

5 14    Yes

Explanation:

8 0
3 years ago
Read 2 more answers
How can you make a search phrase more effective?
Rufina [12.5K]

Answer:

Keep it short: The fewer words you use, the more accurate your search will be. ...

Use quotes: Double quotes around a set of words tells gog.le to consider the exact words in that exact order without any change.

Search a web site: allows you to specify that your search results must come from a given website.

Explanation:

5 0
3 years ago
01000111 01110101 01100101 01110011 01110011 00100000 01110111 01101000 01100001 01110100 00111111
Natasha_Volkova [10]

12435 425 2 52 35 Guess what?

8 0
3 years ago
Other questions:
  • The set of appearance choices for files and folders is known as the
    7·1 answer
  • 1.    Design a circuit that when the binary input is 0, 1, 2, 3,4,5,6, and 7 the binary output is one greater than the input.  W
    13·1 answer
  • Which of the following statements about these signs is true?
    13·1 answer
  • What is the primary benefit of using solid state storage
    7·1 answer
  • Kitchen Gadgets sells a line of high-quality kitchen utensils and gadgets. When customers place orders on the company’s Web site
    7·1 answer
  • Biosolids are used as a chemical free natural choice for fertilizing.
    5·1 answer
  • How many lines of text are in your questionnaire document
    5·1 answer
  • What website or search engine that helps people find the web pages that they are looking for by tying in the subject they want?​
    5·1 answer
  • ________ is the use of information technology to support the sharing of content among networks of users.
    14·1 answer
  • Which of the following includes premium content you must pay to use?<br> On word
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!