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
Nezavi [6.7K]
4 years ago
12

8.10 LAB: Convert to binary - functions Write a program that takes in a positive integer as input, and outputs a string of 1's a

nd 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x
Computers and Technology
1 answer:
Korvikt [17]4 years ago
3 0

Answer:

// This program is written in C++ programming language

// Comments are used for explanatory purpose

// Program starts here

#include <iostream>

#include <string>

using namespace std;

// Declare variables

int inputvar;

// Declare output variable as array

int outputvar[32];

// Set a counter for binary array

int i = 0;

while (inputvar > 0) {

// Divide inputvar by 2 and store remainder in outputvar

outputvar[i] = n % 2;

inputvar/=2;

i++; // increment i by 1

}

// End of division

// Prin resulting array in reverse order

for (int j = i - 1; j >= 0; j--) {

cout << outputvar[j];

}

return 0;

}

// End of Program

You might be interested in
Advantages of a grain crush​
alexgriva [62]

Answer:Crushed grains are usually used to feed ruminant animals. Crushed grain are easier to digest, nutrients are assimilated more easily. Suitable as simply pellets chrusher.

Explanation:

3 0
3 years ago
Which of the following is NOT acceptable to use as proof of
djverab [1.8K]

C because what are rhe chances of your friend having proof on your passengers phone

7 0
3 years ago
Read 2 more answers
In what type of attack does the attacker have the ciphertext of several messages that were encrypted with the same encryption al
Alexus [3.1K]
In ciphertext-only.

EXPLANATION: it is an attack model for cryptanalysis where the attacker is assumed to have access only to a set of ciphertexts. The attack is completely successful if the corresponding plaintexts can be extracted or, even better, the key.
3 0
3 years ago
Daniel owns a construction company that builds homes. To help his customers visualize the types of homes he can build for them,
DanielleElmas [232]

Answer:

The correct answer to the following question will be "Computer-assisted design".

Explanation:

  • CAD seems to be computer software or development for creating 2D as well as 3D features or models.
  • This technology could be used in a wide variety of companies and professions which could be used to produce architectural models, construction aims, renderings, power systems, technical diagrams, blueprints as well as visual effects through your favorite films and shows.

So that Daniel uses certain technology to support or create these 3D designs.

3 0
3 years ago
Which type of digital picture is made by strong individual pixel value
8_murik_8 [283]

Answer  :a bitmap because it is a 'map' of where the 'bits' of information are stored

Explanation:

This information is stored as a sequence of numbers defining the colour of each pixel.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following rules should be used to keep the appropriate distance between your vehicle and the vehicle in front of yo
    10·2 answers
  • The temperature of a plastic cube is monitored while the cube is pushed 8.7 m across a floor at constant speed by a horizontal f
    8·1 answer
  • What types of input and output devices would be ideal for a college student completing his or her coursework?
    8·1 answer
  • Good afternoon guys !!!
    14·2 answers
  • To share a document in my online electronic journal, I should select the option to _____.
    14·1 answer
  • Which type of system requires a regular backup of files
    10·2 answers
  • Compose one paragraph (three to four sentences) explaining the difference between a courtesy copy and a blind courtesy copy (thi
    9·1 answer
  • Who like the videos where is clown is from :)
    6·1 answer
  • A garments manufacturing company buys various types of natural and synthetic materials to produce clothes. Which material is a s
    6·2 answers
  • A small business utilizes a SOHO router and wishes to secure its existing wireless infrastructure. The business has fewer than t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!