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
What are the answers to everfi
FinnZ [79.3K]
FutureSmart focuses on the important Middle School years by empowering students to become the stewards of their financial futures. This three hour web-based resource educates students on the practicalities of daily financial decisions and the payoffs of long-term planning. Since Middle School is an important period for positive habits
to take form and grow, this course is particularly meaningful.
Through a compelling narrative in which students play the Mayor of a town, local citizens are helped with real-life decisions. From weighing opportunity costs, to delaying instant gratification for long- term gain, students face important questions on their way to becoming FutureSmart. At the end of the course, students compose their own blueprint for the future. FutureSmart c
6 0
3 years ago
If anyone know python code, your answer will be valuable.
Veseljchak [2.6K]

Answer:

Explanation:

B

4 0
3 years ago
Read 2 more answers
What are the values of the digital signal when sending in physical layer?
irina [24]

Answer:

A waveform that switches representing the two states of a Boolean value (0 and 1, or low and high, or false and true) is referred to as a digital signal or logic signal or binary signal when it is interpreted in terms of only two possible digits.

8 0
2 years ago
Jacob is preparing a presentation on the health and social advantages of taking up a sport at an early age. Most of the slides i
8090 [49]

Answer:

C. Make the slide image large so the charts can be seen clearly.

Explanation: Edg

8 0
2 years ago
A(n) ______________ ________________ attack keeps the target so busy responding to a stream of automated requests that legitimat
Tanya [424]

Answer:

denial-of-service (DoS) attacks

Explanation:

8 0
3 years ago
Other questions:
  • How to delete audio from powerpoint​
    13·1 answer
  • What happens if i receive a text while my phone is off?
    15·1 answer
  • Which of the following is not regression test case? A. A representative sample of tests that will exercise all software function
    10·1 answer
  • HELP 99PTS If Answered
    12·2 answers
  • How should a Salesforce Admin fulfill those requirements? Universal Containers launches a Partner Community for their resellers
    13·1 answer
  • Select the correct answer.
    10·1 answer
  • Write a couple of paragraphs about the usefulness of computer​
    5·1 answer
  • Write a code that takes numbers from the user as a list. (User can enter as many numbers as he wants). Then, find mean and stand
    15·1 answer
  • In a _____, there is no skipping or repeating instructions. A. iteration B. sequence C. selection D. conditional
    10·1 answer
  • I have all of the points and brainliest, but it won't level up, I don't know why, anyone know why?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!