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
yawa3891 [41]
3 years ago
12

Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less

than 100. End each prompt with a newline. Ex: For the user input 123, 395, 25, the expected output is:
Enter a number (<100):
Enter a number (<100):
Enter a number (<100):
Your number < 100 is: 25
c++

#include
using namespace std;

int main() {
int userInput = 0;

do
cout << "Your number < 100 is: " << userInput << endl;

return 0;
}
Engineering
1 answer:
chubhunter [2.5K]3 years ago
8 0

Answer:

#include <iostream>//including iostream library to use functions such as cout and cin

using namespace std;

int main() {

int userInput = 0;

do

{

 cout << "Enter a number < 100: " ;

 cin >> userInput;

 if (userInput < 100)//condition if number is less than 100

 {

  cout << "Your number < 100 is: " << userInput << endl;

 }

} while (userInput > 100);//do while loop condition

return 0;

}

Explanation:

A do-while loop executes regardless in the first iteration. Once it has run through the first iteration, it checks if the condition is being met. If, the condition is TRUE, the loop begins the second iteration. If FALSE, the loop exits. In this case, the condition is the userInput. after the first iteration, lets say the userInput is 120, the condition userInput > 100 is true.Therefore, the loop will run again until eventually the number is less than hundred, lets say 25. In that case the condition would be 25 > 100, which would be false, so the loops will break.

You might be interested in
Random question, does anyone here use Lego, do not answer unless that is a yes
Sophie [7]

Answer:

yes i have 2 huge bins of it

Explanation:

8 0
3 years ago
Read 2 more answers
Technician A says if the input signal turn-on time is too fast for the input circuit, your program may operate as though the inp
ASHA 777 [7]

Answer:

b. Technician B only

Explanation:

A watchdog timer is a circuit that automatically monitors the MCU (Microcontroller Unit) for any anomaly, detects it and helps the MCU to recover from the malfunction it has detected.

If the input signal turn-on time is too fast for the input circuit, that is a malfunction and this activates the watchdog timer circuit to correct this malfunction immediately. So Technician B only is correct as the watchdog timer is activated immediately once there is a malfunction.

7 0
3 years ago
What is a chipping hammer used for? <br><br> State three things.
aleksley [76]

Answer:

i hope this helps.

Explanation:

they are used for breaking concrete, can be positioned to break vertical and overhead surfaces, allows precisely chip away only specific areas.

7 0
3 years ago
Read 2 more answers
Just need someone to talk to pls dont just use me for points
Allushta [10]

Answer:

well what do you wanna talk about friend?

Explanation:

7 0
3 years ago
Who is father of Engineer?
3241004551 [841]

John Smeatom, U.K. 18th century, was the first self-proclaimed, civil engineer in the 18th century and IS considered “the father of modern, civil engineering”.

hoped this helped! :)

4 0
3 years ago
Read 2 more answers
Other questions:
  • 1 kg of saturated steam at 1000 kPa is in a piston-cylinder and the massless cylinder is held in place by pins. The pins are rem
    5·1 answer
  • Air enters a compressor operating at steady state at 176.4 lbf/in.^2, 260°F with a volumetric flow rate of 424 ft^3/min and exit
    10·1 answer
  • Part A - Transmitted power A solid circular rod is used to transmit power from a motor to a machine. The diameter of the rod is
    8·1 answer
  • List fabrication methods of composite Materials.
    12·1 answer
  • The spring has a stiffness k = 200 N&gt;m and an unstretched length of 0.5 m. If it is attached to the 3-kg smooth collar and th
    12·1 answer
  • How many kg / day of NaOH must be added to neutralize a waste stream generated by an industry producing 90,800 kg / day of sulfu
    6·2 answers
  • potential difference is the work done in moving a unit positive charge from one point to another in an electric field. State Tru
    12·1 answer
  • A two-phase mixture of water and steam with a quality of 0.63 and T = 300F expands isothermally until only saturated vapor rema
    7·1 answer
  • WILL MARK BRAINLIST I need help on this asap thanks
    15·1 answer
  • A furnace uses preheated air to improve its fuel efficiency. Determine the adiabatic flame temperature when the furnance is oper
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!