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
jeyben [28]
3 years ago
5

Write a program that will prompt the user to enter an integer. The program should square the number and then print the squared n

umber. Repeat this process until 0 is entered as input. Use a do-while-loop to do this.
Computers and Technology
1 answer:
Kay [80]3 years ago
3 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// function to compute sum and product

void square(int input)

{

   // variable to store the square of number

   long long squ_num;

   calculate the square of number

   squ_num=pow(input,2);

   // print the output

   cout<<"square of "<< input<<" is: "<<squ_num<<endl;

   

}

// driver function

int main()

{

   int n;

   // read the number until user enter 0

   do{

       cout<<"enter a number!! (0 to stop):";

     // read the input from user

       cin>>n;

       // call the function to calculate square of input number

       square(n);

       

   }while(n!=0);

 

return 0;

}

Explanation:

Declare a variable "n" to read the input number from user.Call the function  square() with parameter "n".In this function, it will calculate the square  of the input number and print it.This will repeat until user enter 0 as  input.Program will ends when user give 0 as input.

Output:

enter a number!! (0 to stop):5                                                                                                                                

square of 5 is: 25                                                                                                                                            

enter a number!! (0 to stop):7                                                                                                                                

square of 7 is: 49                                                                                                                                            

enter a number!! (0 to stop):11                                                                                                                              

square of 11 is: 121                                                                                                                                          

enter a number!! (0 to stop):0

You might be interested in
Select the correct answer.
vaieri [72.5K]

I'm not too sure, but I can remove three of the options above. Artificial Intelligence programmers write code for Artificial Intelligence- tis in the name. Game tool programmers code for video games. Web programmers program webpages or apps for the web.


Of the two options left, I would say that it is most likely D. System Programmers. It's not a definite, though. Good luck!

3 0
3 years ago
Read 2 more answers
Emma won a laptop at her high school science fair. The laptop does not have antivirus software installed on it so Emma must purc
patriot [66]

if the question is if she should..

Explanation:

Yes, she should if she plans to  use it for a couple years she should get the best anti virus software :)

3 0
2 years ago
Plz help asap <br> I'm giving 20 points to whoever answers it right
yKpoI14uk [10]

Answer:

A pneumatic system is a system that uses compressed air to transmit and control energy. Pneumatic systems are used extensively in various industries. Most pneumatic systems rely on a constant supply of compressed air to make them work. This is provided by an air compressor.

A hydraulic system is a drive technology where a fluid is used to move the energy from e.g. an electric motor to an actuator, such as a hydraulic cylinder. The fluid is theoretically uncompressible and the fluid path can be flexible in the same way as an electric cable.

Explanation:

<h3>Examples of pneumatic systems and components </h3><h3>Air brakes on buses and trucks. </h3><h3>Air brakes on trains. </h3><h3>Air compressors. </h3><h3>Air engines for pneumatically powered vehicles. </h3><h3>Barostat systems used in Neurogastroenterology and for researching electricity. </h3><h3>Cable jetting, a way to install cables in ducts. </h3><h3>Dental drill.</h3>

<h3>Hydraulic systems use the pump to push hydraulic fluid through the system to create fluid power. The fluid passes through the valves and flows to the cylinder where the hydraulic energy converts back into mechanical energy. The valves help to direct the flow of the liquid and relieve pressure when needed.</h3>
7 0
2 years ago
You are the IT administrator for a small corporate network. The employee in Office 1 occasionally needs a previous version of he
ladessa [460]

Answer:

Explanation:

Assuming you have Windows 8 or 10 as the operating system, you would need to do the following. In the search input in the taskbar search for "Create a System Restore Point". In this window, navigate to the System Protection tab. Here, you need to click on the drive you want, we can do C first, and click on the button that says "configure". Here you want to turn on System Protection and set the disk space to 5%. Now click apply and ok and repeat for drive D.

Once that is done you will need to create a manual restore point by clicking the button that says create and giving it the name of your choice.

7 0
2 years ago
Which sentence best describes a story's rising action?
MAXImum [283]

Answer:

So first off I’m pretty sure you meant ELA class, but I will still answer the question for you. The sentence that best describes a stories rising action is when it describes the conflicts that lead to the climax of the story. The climax is the main point in a story, and usually towards the middle. (Even though this can vary in book series)

Explanation:

Rising action takes place in a book right before the climax, the main point. This really matter because they have to work it up to the climax. Think of it like a graph. The line won’t just shoot up, it will gradually go up, then gradually go down.

Hope this helped!!

6 0
2 years ago
Other questions:
  • How to write "There are four parking spots on campus that may be used only by Nobel Prize winning faculty." this sentence correc
    12·1 answer
  • What is the full path of the directory on this computer containing the SAM registry hive file
    15·1 answer
  • PLEASE HELP ME!!!!
    12·2 answers
  • Creative Commons Question -- At home, you created a really great digital song, audio jingle, or music track using some software
    12·1 answer
  • Activity Guide - Using the Problem Solving Process answer key anyone got it ?
    6·1 answer
  • A network technician is designing a network for a small company. The network technician needs to implement an email server and w
    7·1 answer
  • What is the best way to improve the following code fragment? if ((counter % 10) == 0) { System.out.println("Counter is divisible
    11·1 answer
  • Write two lines of code to draw the following circles centered at 600,600. The radius of the smallest circle is 200. There are 5
    6·1 answer
  • 4. In computers, an integer can be represented by more than 8-bit, what is the largest positive integer that
    9·1 answer
  • Evaluate and compare free and commercial versions of the Avast antivirus software
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!