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
olasank [31]
3 years ago
8

Refer to the method f: Public int f( int k, int n ) { if( n == k ) return k; else if( n > k ) return f( k, n - k ); else retu

rn f( k - n, n ); } What value is returned by the call f( 6, 8 )?
Computers and Technology
1 answer:
Debora [2.8K]3 years ago
5 0

Answer:

Returned value: 2

Explanation:

Public int f(int k, int n) {

   if (n == k)

       return k;

   else if (n > k)

       return f(k, n - k);

   else return f(k - n, n);

}

/////////////////////////////////////////////////////////////////////////////////////////

Trace of function calls,

f(6, 8)

f(k, n - k) -> (6, 2)

f(k - n, n) -> (4, 2)

f(k - n, n) -> (2, 2)

return k

You might be interested in
Write a program code which asks for 80 numbers between 100 and 1000 to be entered.
Firlakuza [10]

Answer:

If you are using Python,

```count = 0

for i in range(0, 79):

a = int(input("Input a number: "))

if 100 <= a <= 1000:

 if a > 500:

  count += 1

else:

 print("Please input a number between 100 and 1000!")

 i -= 1

print(count)```

Explanation:

count refers to the number of 500s and above,

the for loop is required for the program to loop 80 times,

a is the input collected,

the nested if is to check whether the number is above 500 and the if is used to check if the number is between 100 and 1000 if not, it will output that you need to input a number between 100 and 1000,

the i-=1 is required to make sure that part wasn't counted.

and the last print is to output the number of numbers above 500

8 0
2 years ago
Haley is responsible for checking the web server utilization. Which things should she review while checking the server utilizati
const2013 [10]

Answer:

While checking the server utilizations, she should review CPU and RAM.

Explanation:

8 0
2 years ago
Read 2 more answers
Which marketing strategy is represented by advertisers paying for online display ads?
e-lub [12.9K]

Answer:

The answer is (c) paid media

Explanation:

Because they are paying for the ad to be displayed online. hope this helps!

8 0
3 years ago
Help me if you do then you get 10 points and brainliest
stellarik [79]

The answer is A. The earth was formed 4.54 years ago, and during those first serveral hundred million years, oceans, continents started to form.

A) Precambrian time.

3 0
3 years ago
What kind of information can be found in a ROM:
tester [92]
The answer is C, ROM often stores the basic instructions a computer needs when powering on, part if the BIOS.
3 0
3 years ago
Other questions:
  • How useful is the creation of folders for your computer
    9·1 answer
  • When you are shopping online and finalizing your order, you usually fill in forms for your name, address, email, and payment met
    6·1 answer
  • _____________ is the characteristic of a resource that ensures that access is restricted to only permitted users, applications,
    14·1 answer
  • A. True <br> b. False: variables represent storage locations in the computer's memory.
    13·1 answer
  • Declare an array named tax rates of five elements of type double and initialize the elements (starting with the first) to the va
    12·1 answer
  • A junior administrator is having issues connecting to a router's console port using a TIA/EIA 568B standard cable and a USB seri
    5·1 answer
  • Write a Java program that prompts the user for an int n. You can assume that 1 ≤ n ≤ 9. Your program should use embedded for loo
    5·1 answer
  • The use of desktop computer equipment and software to create high-quality documents such as newsletters, business cards, letterh
    14·1 answer
  • The Uniform Electronic Transmission Act (UETA) a. declares that e-signatures are invalid. b. has only been adopted in a handful
    8·1 answer
  • How would you explain how a password generator program works
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!