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
tamaranim1 [39]
3 years ago
10

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)
Computers and Technology
1 answer:
a_sh-v [17]3 years ago
5 0

Answer:

using python to write the program

Explanation:

#To use the log function, the module must be imported

import math

n=int(input("Enter number to be halved"))

count=0

while(n>1):

   count=count+1

   n=n//2

print("The number halved is now ", n, "The is the ", count, "iteration")

x = math,log(2,(n))

print("The log of n is:", x)

You might be interested in
A date for creation or revision<br> is mandatory for all web pages?
rewona [7]

Answer:

I do believe so

Explanation:

Most websites have this, as far as I know

5 0
2 years ago
In Windows-based systems, a value that specifies the rights that are allowed or denied in an access control entry (ACE) of an ac
blsea [12.9K]

Answer:

C. Access mask discretionary.

Explanation:

Access_Mask is the value that defines the rights used in access control entries (ACE), this value identifies if the trustee is allowed to access a secured object.

It can define rights in three categories: Standard, specific and generic rights.

4 0
3 years ago
How can the geographic location of data centers be beneficial for a company that is concerned about sustainability?
goldfiish [28.3K]
Answer : A- by placing data centers in remote areas so that their emissions are less of a concern. B- by allowing the use of renewable local resources such as solar or wind energy
6 0
3 years ago
__________ is a special place on the hard drive where items from memory can be temporarily stored for fast retrieval
andrew-mc [135]
The answer is swap file 
6 0
3 years ago
Read 2 more answers
Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (a
allsm [11]

Answer:

The code is below. The output is "Eric went to Chipotle to buy 12 different types of Cars"

Explanation:

import java.util.scanner;

public class labprogram {

    public static void main (string [ ] args) {

    scanner scnr = new scanner (system.in) ;

    string firstname;

    string genericlocation;

    int wholenumber;

    string pluralNoun;

   firstName = scnr.next();

   genericLocation = scnr.next();

   wholeNumner = scnr.nextInt();

   pluralNoun = scnr.nextLine();

   system.output.println(firstname + " went to " + genericlocation + " to buy " + wholenumber + " different types of " + pluralnoun + " . ");

}

 }

6 0
3 years ago
Other questions:
  • Tanner has had many different jobs. He previously designed the playscape at the local park with natural rocks, creeks, and veget
    10·2 answers
  • Ip addresses and their corresponding domain names are used to identify computers available through the internet.
    15·1 answer
  • 3k means about 3 thousand bytes. how would you express two hundred million bytes? .
    8·1 answer
  • How is a computer and a iphone different
    9·1 answer
  • Which of the following things should you do first when planning your career?
    15·2 answers
  • I want to know why almost every single "expert answer verified" thing I come across is wrong. If it's wrong, why the h is it exp
    8·2 answers
  • Would you prefer to use an integrated router, switch, and firewall configuration for a home network, or would you prefer to oper
    5·1 answer
  • What is the BCC feature used for?
    12·2 answers
  • Which of the following events happened first
    15·2 answers
  • Please answer this question​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!