subject

Write a program to prompt the user for a positive integer: N. The program will repeatedly divide the input in half using a loop, discarding any fractional part, until it becomes 1. The program should print on separate lines:
• the sequence of ‘halved’ value, one per line
• the number of iterations required
• the value of log2(N)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
Select all that apply. which of the following are proofreading options included in microsoft word? spell check find replace grammar check formatting check
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 23.06.2019 12:50
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
When is it most apprpriate for a development team to change the definition of done
Answers: 1
You know the right answer?
Write a program to prompt the user for a positive integer: N. The program will repeatedly divide the...
Questions
question
Mathematics, 29.10.2020 01:00
question
History, 29.10.2020 01:00
question
Chemistry, 29.10.2020 01:00
question
Mathematics, 29.10.2020 01:00
question
Mathematics, 29.10.2020 01:00
Questions on the website: 13722360