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
sergiy2304 [10]
3 years ago
5

6.27 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:
Engineering
1 answer:
Olin [163]3 years ago
4 0

Answer:

//Convert any decimal number to binary number

//Program is written in C++ Programming Language

// Comments are used for explanatory purpose

// Program starts here

#include <iostream>

using namespace std;

// Main Method declared here

int main()

{

    int x;

   cout<<"Enter any integer number: ";

    cin>>x;

   DecBin(x);

   return 0;

}

// Here a function named DecBin is declared along with an integer variable, x

void DecBin(int x)

{

   // Declare an array to store the resulting binary digits

   int bindigit[32];

   // counter for binary array

   int kount = 0;

   while (x > 0) {

       // Store the remainder of each division in the declared array

       bindigit[kount] = x % 2;

       x = x / 2;

       kount++;

   }

   // Loop to print the binary digits in reverse order

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

          {

       cout << bindigit[j];

        }

}

// End of Program

You might be interested in
1. Springs____________<br> energy when compressed<br> And _________energy when they rebound.
densk [106]

Answer:

Springs store energy when compressed and release energy when they rebound

Explanation:

6 0
3 years ago
Select three types of lines that engineers use to help represent the shape of a design in a sketch.
Vikki [24]

Hidden lines

  • Used to describe the in shown lines (like diagonals inside cubes)

Extension lines:-

  • Used to explain the expansion of structures like building

Object lines

  • Used to describe the structure of objects and the lining to show borders
7 0
3 years ago
How many types of arcs do we have in AutoCad? O a.9 O b. 10 Oc. 12 O d. 11​
Dmitry [639]

Answer:

Letter D

Explanation:

AutoCAD provides eleven different ways to create arcs. The different options are used based on the geometry conditions of the design. To create an arc, you can specify various combinations of center, endpoint, start point, radius, angle, chord length, and direction values.

8 0
3 years ago
Read 2 more answers
As the impurity concentration in solid solution of a metal is increased, the tensile strength:________.a) decreasesb) increasesc
valkas [14]

Answer:

Increases

Explanation:

By inhibiting the motion of dislocations by impurities in a solid solutions, is a strengthening mechanism. In solid solutions it is atomic level strengthening resulting from resistance to dislocation motion. Hence, the strength of the alloys can differ with respect to the precipitate's property. Example, the precipitate is stronger (ability to an obstacle to the dislocation motion) than the matrix and it shows an improvement of strength.

5 0
4 years ago
Establishes general guidelines concerning licensing and vehicle
gavmur [86]

Answer:

A. National Highway Safety Act

Explanation:

The National Highway Safety Act establishes general guidelines concerning licensing, vehicle registration and inspection, and traffic laws for state regulations. The act was made in 1966 to reduce the amount of death on the highway as a result of increase in deaths by 30% between 1960 and 1965

National Traffic and Motor Vehicle Safety Act regulates vehicle manufacturers  by ensuring national safety standards and issuance recalls for defective vehicles

Uniform Traffic Control Devices Act  defines shapes, colors and locations for road signs, traffic signals, and road markings

5 0
3 years ago
Read 2 more answers
Other questions:
  • A 300 mm long steel bar with a square cross section (25 mm per edge) is pulled in tension with a load of 83,051 N , and experien
    10·1 answer
  • A evolução da malha rodoviária do Brasil é um marco notável
    9·1 answer
  • Who tryna play fortnite with me
    11·2 answers
  • A water tower that is 90 ft high provides water to a residential subdivision. The water main from the tower to the subdivision i
    10·1 answer
  • In your opinion, what is the external opportunity cost of a successful biking company in a community
    7·1 answer
  • A Barnes and Books is interested in purchasing a two-story building for a new
    5·1 answer
  • Consider the titration of 100.0 mL of 0.200 M CH3NH2 by 0.100 M HCl.
    13·1 answer
  • Nguyên lý hoạt động của kim phun
    7·1 answer
  • Why charles babbage is known as father of computer explain <br>​
    12·1 answer
  • Similarity of surface<br>and ground<br>waler​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!