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
Paha777 [63]
3 years ago
12

Write a function named max that accepts two integer values as arguments and returns the value that is the greater of the two. Fo

r example, if 7 and 12 are passed as arguments to the function, the function should return 12. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is the greater of the two
Computers and Technology
1 answer:
RoseWind [281]3 years ago
6 0

Answer:

The solution code is written in Python

  1. def max(a, b):
  2.    if(a > b):
  3.        return a  
  4.    else:
  5.        return b
  6. num1 = int(input("Please input the first number: "))
  7. num2 = int(input("Please input the second number: "))
  8. print(max(num1, num2))

Explanation:

Firstly create a function max that accepts two input, a and b, as required by question (Line 1). In the function, create if statement to check if a greater than b return a and vice versa (Line 2 -5).

In the main program (Line 7 - 10), prompt user to input two numbers (Line 7 - 8). At last call the function by passing num1 and num2 as arguments and print the result (Line 10).

You might be interested in
Which of the following is generally true about Open Source Software?
JulijaS [17]
<span>Open source software is usually free to download and install, and it can be studied, changed, and distributed according to the rights of the software. I don't believe there is any copyright laws on this type of software. The most known open source software is Linux and it's available for most operating systems right now. Typically, open source owners just ask for donations for their work.</span>
3 0
4 years ago
The 8-bit ____ field is used by source network hosts and forwarding routers to distinguished classes or priorities in ipv6 packe
noname [10]
It is the 8-bit priority field hopes it helps

7 0
3 years ago
What is stored by a reference variable?What would be the results after the following code was executed? int[] array1 = {10, 20,
Romashka [77]

Answer:

Both array1 and array2 would be pointing to the array with {20,30,50,60}.

Explanation:

array1 and array2 are references (pointers) to the array.

array1 = array2; only makes the array1 variable point to the same destination as the array2 variable.

The next assignment array2 = array1; therefore doesn't change anything. array2 was already pointing to this location.

8 0
3 years ago
Explain the saying "Dress for the position you want, not the position you have."
vfiekz [6]
I think its more like when you are applying for a job. If you are going into an interview (even if its just for mcdonalds) you would want to dress nicely to give a good impression. 
5 0
4 years ago
Read 2 more answers
Which sata version supports transfer speeds up to 6 gb/s?
serg [7]

If you mean Gbit/s (GB/s is different), then you're referring to SATA III, it supports 6 Gbit/s performance :)

4 0
4 years ago
Other questions:
  • Explain why the 7 bit standard ASCII code needs to have the highest bit set to a zero
    11·1 answer
  • Compare a Wi-Fi hotspot with a cybercafé.
    6·1 answer
  • What the repeal of online privacy protections means for you?
    8·1 answer
  • A​ _______ variable is a variable that has a single numerical​ value, determined by​ chance, for each outcome of a procedure.
    7·1 answer
  • Why must programs written in a high level language be translated into machine language before they can run?
    14·1 answer
  • 2. Which the following may be a reason for giving a Page Quality (PQ) rating og Highest? Select all that apply (True or False)
    14·1 answer
  • In a period of steep increases in interest rates, which issuer is most likely to be negatively affected? A Trucking company B Ut
    9·2 answers
  • Assume that programs spend about 25% of their time waiting for I/O operations to complete. If there are FOUR programs loaded int
    9·1 answer
  • What are the different methods of enhancing/decorating<br> bamboo product​
    15·1 answer
  • How to transfer crypto from coinbase to coinbase wallet
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!