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
GarryVolchara [31]
3 years ago
13

Assume you want to write a code to calculate the addition of two numbers digit by digit. Provide the running time for your algor

ithm, assuming the inputs are two n-digit numbers. Explain your answer
Computers and Technology
1 answer:
Sergio039 [100]3 years ago
5 0

Answer:

Explanation:

Using Python programming language

Explanation:

1. I defined a function add and passed in two parameters (a,b).

2. In the block of the function, I added the two numbers and printed the result.

3. I decided to use a function so that the program is re-usable and can accept various inputs.

Find the code below. (# are used for comments)

#Addition of numbers

def add(a,b):

   print(a+b)

#Test Cases

add(2,4.5)      #Result=6.5

add(10,290)     #Result=300

add(2.567,4.58) #Result=7.147

You might be interested in
Identify the modern-day printmaking process, also known as screenprinting, in which the artist squeegees paint through a mesh sc
aliya0001 [1]
Serigraphy is another word for this!
5 0
3 years ago
Why shouldn't a server use a glass to scoop ice?
natali 33 [55]
A server shouldn't use a glass to scoop ice as the glass may break. This is due to the potential temperature difference between the glass (which may be room temperature or hotter if it is taken from a dishwasher), and the cold ice. Any existent hairline fractures in the glass may then expand and crack, whereby the smashed pieces of glass could then land in the client's food, table or lap, potentially causing injury to the person. 
7 0
4 years ago
Read 2 more answers
Why computer known as tool of information​
S_A_V [24]

Answer:

because it has the ability to capture the whole information you need or downloaded

8 0
2 years ago
What is the default setting Excel shows when Insert is clicked?
NikAS [45]

Answer: entire column

7 1
4 years ago
Read 2 more answers
One way to save time and get to the colleges that you are most interested in at a college fair is to
son4ous [18]

Answer:

Identify the location of the college stand in advance.

Explanation:

One way to save time and get to the colleges that you are most interested in at a college fair is to find out in advance the information about the fair, the colleges that are participating and from that pick the more interesting ones and identify the location of their stands. Like that when you arrive to the fair you can go directly to them and find them easily which will save you a lot of time as you won't be walking around the whole place to find them.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Automotive engine cylinder heads can be made of what?
    7·1 answer
  • Ideation includes all of the following EXCEPT
    5·1 answer
  • Describe one type of technology that is useful in producing images from space.
    9·1 answer
  • With arbitrary code execution, the ________________ launches ("spawns") a command shell from which instructions can then be issu
    11·1 answer
  • Your boss is very skeptical about the idea of storing his files up in the cloud rather
    8·1 answer
  • ECG mashine is an example of
    12·1 answer
  • Who put forward the idea of nanotechnology to the world?​
    6·1 answer
  • SLA:
    14·1 answer
  • What does mean in computer science
    10·1 answer
  • I am in class 7 should I go with java or python.​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!