subject
Computers and Technology, 20.03.2020 22:02 EMQPWE

Problem 3: Write a recursive function getGCD to calculate the greatest common denominator of two given numbers. For example, getGCD( 12, 9) = 3. The function should have the following declaration: function gcd = getGCD( n1, n2) where inputs n1 and n2 are positive integers and output gcd is the greatest common denominator of n1 and n2. The function should have a description. When the inputs are not positive integers, set the output to be a string 'Error' and use return to exit the function. (a) Set p3a = evalc('help getGCD').

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Kyle wants to access his school’s home page. how can he do this?
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
Ihave an iphone 8plus should i get another phone like samsung note 9 or s9 ? ?
Answers: 2
question
Computers and Technology, 22.06.2019 11:30
Write a function so that the main program below can be replaced by the simpler code that calls function original main program: miles_per_hour = float( minutes_traveled = float( hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('miles: %f' % miles_traveled) sample output with inputs: 70.0 100.0 miles: 116.666667
Answers: 3
question
Computers and Technology, 22.06.2019 18:00
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
You know the right answer?
Problem 3: Write a recursive function getGCD to calculate the greatest common denominator of two giv...
Questions
question
Mathematics, 15.12.2020 18:10
question
Mathematics, 15.12.2020 18:10
question
Mathematics, 15.12.2020 18:10
question
Mathematics, 15.12.2020 18:10
question
Mathematics, 15.12.2020 18:10
question
Mathematics, 15.12.2020 18:10
Questions on the website: 13722362