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]
4 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]4 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
How many days till earth ends
expeople1 [14]
Several Billion years
5 0
3 years ago
Consider the practice of outsourcing programmers, a common practice in many U.S. businesses. Think about how this practice is us
GuDViN [60]

The practice of outsourcing programmers is known to be the act of  sharing or delegating as well as handing over control of programming and its associated tasks to any form of  external service provider that is said to be very good in that field and has the power and capabilities to handle the technical and operational areas of a programming project.

<h3>What is outsourcing and why is it always practiced?</h3>

Outsourcing is known to  be a kind of a business practice that entails the act of hiring a party that is known to be outside a company to carry out services or make goods that are said to be traditionally carried out in-house.

Note that The practice of outsourcing programmers is known to be the act of  sharing or delegating as well as handing over control of programming and its associated tasks to any form of  external service provider that is said to be very good in that field and has the power and capabilities to handle the technical and operational areas of a programming project.

Learn more about outsourcing  from

brainly.com/question/12101789

#SPJ1

5 0
2 years ago
Write a python program to accept a number and check whether it is divisible by 4 or not​
Alenkasestr [34]

Answer:

number = int(input("Enter number: "))

if (number % 4):

 print("{} is not divisible by 4".format(number))

else:

 print("{} is divisible by 4".format(number))

Explanation:

If the %4 operation returns a non-zero number, there is a remainder and thus the number is not divisable by 4.

5 0
3 years ago
You are working on a small network. You recently created a wireless network to allow the owners laptop and mobile devices to mak
Gekata [30.6K]

Answer: enable network encryption to prevent authorized computer from accessing the wireless network.

Explanation:

1.open the wireless security settings on your router’s configuration page.

2. select security method you wish to use.

3.Enter a passphrase needed to access the network whenever authorizes personnel want access to network.

5 0
4 years ago
01101000 01101111 01110111 00100000 01100100 01101111 01100101 01110011 00100000 01100010 01101001 01101110 01100001 01110010 01
Pavlova-9 [17]

Answer:

:>

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • You have been tasked with finding the routers that have been installed between two networks. what utility would you use to provi
    5·1 answer
  • I’m buying a prebuilt pc once I get it and set it up, what do I need to install on it?
    14·1 answer
  • Which of the following is a reason photographing animals can be difficult?
    9·2 answers
  • The ret instruction (without operands) will pop how many bytes off the stack?
    7·1 answer
  • Page _____ refers to whether a page is laid out vertically or horizontally.
    12·1 answer
  • Electricity was seen as a mysterious force and began to creat a stir when people called​
    13·1 answer
  • A computer processor can become extremely hot and must be cooled. A heat sink is placed on top of the processor to extract its h
    13·1 answer
  • Which command is used to copy entire folder structures between volumes or across a network while maintaining all NTFS file permi
    10·1 answer
  • For risk monitoring, what are some techniques or tools you can implement in each of the seven domains of a typical IT infrastruc
    7·1 answer
  • Why is my computer fans making weird noises?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!