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
Mariulka [41]
3 years ago
13

Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binar

y. 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:
mylen [45]3 years ago
3 0

Answer:

The program to this question can be described as follows:

Program:

num= int(input('Enter a number: ')) #input value by user

st = '' #defining string variable

while num > 0: #define loop to calculte values binary number

   val= num % 2 # holding remainder (0 or 1) in val variable

   st =st+str(val) # store value in str variable

   num = num//2 #calculte quotient value

print("binary number is: ",st)

Output:

Enter a number: 5

binary number is:  101

Explanation:

Program description as follows:

Firstly the "num" variable is declared, for user input, then an "st" variable is declared, to calculates user input value binary number.

In the next step, a while loop is declared, inside the loop, another variable "Val" is declared, that holds value remainders, which is added on the "st" variable.

Outside the loop, the print method is used, that prints st variable holds value.

You might be interested in
Son opciones de configuración espacio multimedia llamado blog
Softa [21]

NSaAnswer:

th

Explanation:

nks

6 0
3 years ago
Match the item to the type.​
Roman55 [17]
The chart with the circle in the top right is a pie chart

the top left chart on enrollment is a histogram

the bottom chart is a bar chart
3 0
2 years ago
Some 3d printers work by controlling the exact locations where a liquid
kow [346]
Were a liquid what? id doesn't make any sense.
6 0
3 years ago
______is a multimodal application software platform. the centrealized and shared database system ties the entire organization to
m_a_m_a [10]

Answer:

ERP.  

Explanation:

Enterprise Resource Planning Is the software platform for bidirectional applications. The main objective of  ERP it shared the database system and connects the enterprise as a whole so that data can be reached the once and made accessible to all users.

The main advantage of Enterprise Resource Planning is that Enterprise cycle parallelization or optimization it also the boost performance of the organization and saving the time.

3 0
3 years ago
Which tab is used to insert a hyperlink onto a slide
Roman55 [17]
The tab used to instead a Hyperlink into a slide is the Insert tab under the “Links” group.
5 0
3 years ago
Read 2 more answers
Other questions:
  • NEED HELP(10 POINTS) PLEASE HELP MATH
    8·2 answers
  • The_provides access to the internet may also be internal​
    9·1 answer
  • Universal Containers is tracking the interviewer's ratings of candidate in Salesforce. They would like to easily link the Candid
    5·1 answer
  • Many people keep time using a 24 hour clock (11 is 11am and 23 is 11pm, 0 is midnight). If it is currently 13 and you set your a
    10·1 answer
  • Which type of development metrics does Instagram most improve when it releases an update in the App Store to fix errors its cust
    15·1 answer
  • So can u please follow my new ig acc i just started it yesterday its called stunnerspamz
    5·2 answers
  • Ok.,so i have a sopitify account and by accident i pressed the downlaod on button and it says start you free trial i pressed tha
    11·2 answers
  • The stub: transmits the message to the server where the server side stub receives the message and invokes procedure on the serve
    8·1 answer
  • What is the difference between the byte and short data types in Java?
    7·1 answer
  • What are the cloud storage components
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!