subject

The greatest common divisor of two positive integers, a and b, is the largest number that can be evenly divided into both of them. euclid’s algorithm can be used to find the greatest common divisor (gcd) of two positive integers. you can use this algorithm in the following manner: compute the remainder of dividing the larger number by the smaller number. replace the larger number with the smaller number and the smaller number with the remainder. repeat this process until the smaller number is zero. the larger number at this point is the gcd of a and b. write a program that lets the user enter two integers and then prints each step in the process of using the euclidean algorithm to find their gcd. an example of the program input and output is shown below: enter the smaller number: 5enter the larger number: 15the greatest common divisor is 5

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What is used to analyze and summarize your data without graphical support
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
Sports and entertainment class, your goal is to increase attendance and make a profit for a game by getting your team on a winning track with total salaries less than $3,000,000
Answers: 3
question
Computers and Technology, 23.06.2019 19:00
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words.size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words.size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
You know the right answer?
The greatest common divisor of two positive integers, a and b, is the largest number that can be eve...
Questions
question
Mathematics, 17.08.2021 22:40
question
Mathematics, 17.08.2021 22:50
question
Health, 17.08.2021 22:50
question
English, 17.08.2021 22:50
question
Biology, 17.08.2021 22:50
Questions on the website: 13722363