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
Is USA TestPrep a test-taking site that won't let you access other windows without kicking you off?
olga_2 [115]

Answer:

usatestprep literally just does what the name says; it prepares you for tests in america. it doesn't kick you off if you access other windows

Explanation:

3 0
4 years ago
That agreement received after completing it to your program at a community college is called a
Zanzabum

Answer :  Articulation Agreement.

Explanation :

Articulation is a general contract between some colleges and universities which allows a student to easily go to another university for more education. It is a formal agreement between two parties documenting the transfer policies for some specific programs or academic courses.

The articulation agreement is given only when the program is completed at the community college with good behaviour and academic record. The argument documents a pathway between two colleges or universities and their academic programs.

3 0
3 years ago
Design a class named largeIntegers such that an object of this class can store an integer of any number of digits. Add operation
SpyIntel [72]

Answer:

Here the code is given as follows,

Explanation:

Code:

import java.util.Scanner;

//created class named largeintegers

class largeintegers{

   //class can hold a long number

   long number;

   //constructor to set number

  largeintegers(long number){

      this.number=number;

  }

  //getNumber method to get number

  long getNumber(){

      return number;

  }

  //below are some basic operations

  long addition(long num1,long num2){

       return num1+num2;

   }

   long subtract(long num1,long num2){

       return num1-num2;

   }

   long multiply(long num1,long num2){

       return num1*num2;

   }

   boolean compare(long num1,long num2)

   {

       return num1>num2;

   }

  public static void main(String[] args) {

      //declared to long numbers

      long number1,number2;

      //scanner class to take user input

      Scanner sc= new Scanner(System.in);

      //taking input numbers

      System.out.println("Enter a Number ");

      number1=sc.nextLong();

      System.out.println("Enter 2nd Number :");

      number2=sc.nextLong();

      //created two objects

      largeintegers object=new largeintegers(number1);

      largeintegers object2=new largeintegers(number2);

      //displaying two numbers

      System.out.println("Entered Numbers ");

      System.out.println(object.getNumber());

      System.out.println(object2.getNumber());

      //calling basic methods using created objects

      System.out.println("Some Operations on Given two Numbers ");

      System.out.println("Addition:"+object.addition(object.getNumber(), object2.getNumber()));

      System.out.println("Subtraction:"+object.subtract(object.getNumber(), object2.getNumber()));

      System.out.println("Multiplication:"+object.multiply(object.getNumber(), object2.getNumber()));

      System.out.println("Comparison:");

      if(object.compare(object.getNumber(), object2.getNumber())==true)

      {

          System.out.println("First Number is Greater than Second Number ");

      }

      else

      {

          System.out.println("Second Number is Greater than First Number ");

      }

      sc.close();

  }

}

Output:-

6 0
3 years ago
Explain what an IM is, and what is the technology shown in the accompanying figure
sergiy2304 [10]

Answer: Instant Message

Explanation:

7 0
3 years ago
Read 2 more answers
Your manager asks you to get details on a computer crash. What Windows Administration Tool could you use?
Law Incorporation [45]
  • The answer is "Option C" because the WMD is a freeware memory test software that works excellently.
  • It is a comprehensive math question, and it is also quite straightforward to use.
  • They suggest that you first test your ram with Memtest86, but you really should always test a second time with a different memory testing application to be certain.
  • Microsoft Windows Diagnostic is the second tool, that scans your laptop's physical memory & identifies any faults.
  • It requires a reboot to be used the system that will restart, and you'll be unable to your mouse in the Memory Diagnostic Tool.

The wrong choices can be defined as follows:

  • In option a, it is wrong because the data warehouse transforms data into information that may be used by an organization's decision-making process.
  • In option b, it is wrong because by using Metrics Collector Groups and logging the data, it was able to display real-time market data as well as collect and store data.
  • In option d, it is wrong because this is a tool used in Windows, which displays detailed information about major events that have taken place on your machine.
  • In option e, it is wrong because messages and trace logs could be viewed and sorted using the Log Viewer.

Learn more:

Memory Diagnostic: brainly.com/question/13606234

3 0
3 years ago
Read 2 more answers
Other questions:
  • A key or combination of keys that complete an action more efficiently than using the mouse is called a(n) keyboard shortcut.
    8·1 answer
  • Membrane-bound organelles are not found in the cells of A) bacteria. B) fungi. C) plants. Eliminate D) protists.
    15·2 answers
  • Question 1
    10·1 answer
  • Which of the following regarding the Ames test is true? a. It is used to identify newly formed auxotrophic mutants. b. It is use
    14·1 answer
  • Liam is a hacker who tries to access Wi-Fi signals while driving his car. What type of wireless network attack is this?
    9·1 answer
  • Jenny, a programmer, uses Microsoft Excel 2016 to generate data required for the programs she develops. She uses various functio
    10·1 answer
  • Police officers conducting traffic stops on minority drivers more than non-minority drivers is an example of what?
    8·1 answer
  • Identify one technology tool used for work​
    7·1 answer
  • __________ translates analog voice signals into digital data and uses the Internet to transport the data.
    7·1 answer
  • A ________ is a small, lightweight, power-conserving, computing device that is capable of wireless connectivity.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!