answer.
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
Otrada [13]
2 years ago
14

Write a while loop that prints usernum divided by 2 until user_num is less than 1. The value of user_num changes inside of the l

oop. Sample output with input: 20 10.0 5.0 2.5 1.25 0.625
Computers and Technology
1 answer:
zaharov [31]2 years ago
5 0

Answer:

The program to this question can be describes as follows:

Program:

#include <iostream> //defining header file

using namespace std;

int main() //defining main method

{

float user_num ;//defining float variable

cout<<"Enter any number: "; //message

cin>>user_num; //input value from the user

while (user_num >= 1) //defining loop to calculate value

{

user_num =user_num/ 2; //diving the value

cout<<user_num<<endl; //print value

}

return 0;

}

Output:

Enter any number: 20

10

5

2.5

1.25

0.625

Explanation:

In the above program, a float variable user_num is declared in which we store input value from the user end, in the next step, a while loop is declared, which calculates, the given value.

  • In the loop a condition is defined, that user_num value is greater than equal to 1, inside the loop it will divide the value of the user_num and store in this variable.
  • In this print, the method is used, which prints its variable values.
You might be interested in
A computer application such as Microsoft Access that is used to store data and convert it into information is a ________________
lorasvet [3.4K]
All data is stored in table
5 0
2 years ago
Multiple boolean expressions can be combined by using a logical operator to create ________ expressions.
Licemer1 [7]
<span>Boolean expressions can be combined by using a logical operator to create compound expressions. A boolean expression is an expression that takes into account and evaluates specific data, which is in the form of true and/or false. A compound expression is merely a statement of expressions.</span>
8 0
2 years ago
Someone claims that the big O notation does not make sense at all, and they give the following example. An algorithm A that proc
Svetllana [295]

Answer:

Big Oh notation is used to asymptotically bound the growth of running time above and below the constant factor.

Big Oh notation is used to describe time complexity, execution time of an algorithm.

Big Oh describes the worst case to describe time complexity.

For the equation; T(N) = 10000*N + 0.00001*N^3.

To calculate first of all discard all th constants.

And therefore; worst case is the O(N^3).

7 0
2 years ago
A cyber criminal sends a series of maliciously formatted packets to the database server. The server cannot parse the packets and
telo118 [61]

Answer:

DoS attack

Explanation:

A Denial of Service attack involves the sending of maliciously formatted data packets to a server. The packet can be larger than the allowed IP size such that when it arrives at the server, the server cannot identify the headers in the data packet for it to process and extract data. The server can either freeze or crash, denying allowed users access to its resources and making it unavailable.

7 0
2 years ago
Type the correct answer in the box. Spell all words correctly.
kvasek [131]

Answer:

Presentations?

Explanation:

6 0
2 years ago
Other questions:
  • U.S. industries like steel, computers, and energy need to be protected from foreign competition to ensure which of the following
    6·2 answers
  • A chemical found in the synaptic vesicles , which , when released . has an effect on the next cell is called a?
    10·1 answer
  • Blender questions
    8·2 answers
  • Write a program that computes and prints the average of the numbers in a text file. You should make use of two higher-order func
    9·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • Write a program that prints the U.S. presidential election years from 1792 to present day, knowing that such elections occur eve
    9·1 answer
  • What is the Gain (dB) of a transmission if the Maximum Data Rate is 1 Gbps and the Bandwidth =7000 MHz? Group of answer choices
    6·1 answer
  • On a webpage, a _____ provides supplemental material such as social networking feeds and ads. Group of answer choices footer sid
    9·1 answer
  • Write a program that calculates taxi fare at a rate of $1.50 per mile. Your pro-gram should interact with the user in this manne
    12·1 answer
  • [20 points] 3.3 Code Practice: Question 2
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!