Prompt user to enter two integer and read them from keyboard

Assignment Help Programming Languages
Reference no: EM13694515

Question: You are required to do the subsequent:

- Part 1: Prompt the user to enter two integers and read them from the keyboard.

- Part 2: Create a loop, and inside of it replace the larger integer with the difference between the larger integer and the smaller integer (if the integers are equal you may choose either one as the "larger") during each iteration. You will need to use an if/else statement to determine the larger value.

- Part 3: Continue looping until the two integers are equal.

- Part 4: Print out the remaining value as the gcd. See the sample output below.

I'm not sure how to solve the question. Can anyone help me?

Reference no: EM13694515

Questions Cloud

What is qos what is it used for and how does it work : What is QOS what is it used for and how does it work and What are the differences between Inserv and Diffserv
What is the expected time to find a key by exhaustive : Given a computer that can test 2^40 keys each second. What is the expected time to find a key by exhaustive search given a key space, say 2^88. How do you go about figuring this out? Is there a formula or standard equation that is used?
Calculate and display the area of the rectangle : Calculate and display the area of the rectangle and the total price of the tile. Add comments in code section. Code this program in java programming.
Calculates the total number of votes received by a candidate : Calculates the total number of votes received by a candidate - the function updateVotesByRegion (of the class candidateType) updates only the number of votes for a particular region.
Prompt user to enter two integer and read them from keyboard : Create a loop, and inside of it replace the larger integer with the difference between the larger integer and the smaller integer (if the integers are equal you may choose either one as the "larger")
How to encrypt a message using a stream cipher : How to encrypt a message using block cipher algorithms we covered in class? What are the similarities and differences between those algorithms and How to encrypt a message using a stream cipher?
Create an interface called player : Create an interface called Player. The interface has an abstract method called play() that shows a message describing the meaning of "play" to the class.
How much energy is stored in the flywheel : What is the average power delivered to the machine and how much torque does the flywheel exert on the machine?
Write a program that keeps an employee database : Write a program that keeps an employee database in a random-access file. Implement functions for adding and removing employees. You need not keep employees in sorted order.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a program in q basic that accept student name

Write a program in Q basic that accept a student name,score obtained in 5 course and compute the average score of the student and my program must display the name of the student

  Is this an example of head or tail recursion

Referring to the code in Part 1, use the substitution model to illustrate what the result of calling (add1-iter '(1 2 3)) will be. Why is the list reversed ?

  Develop application for company having breakdown of payroll

Develop the logic for application for company which wishes report containing breakdown of payroll by department. Input comprises each employee's name, department number.

  One-dimensional as array of counters to solve problem

Write program which determines how many salespeople earned salaries in each of following ranges. Use the one-dimensional as the array of counters in solving this problem

  Computer sales and repair store system

It is required to design a relational database system for a "realistic" application

  Write vl program to convert leagues-number of nautical miles

Write a VL program which will convert 20,000 leagues to number of nautical miles. Your program requires no input elements, just elements to compute result and output how many nautical miles is equivalent to 20,000 leagues.

  Create a user interface that uses the gridlayout manager

Define and compile the following two classes that will represent seats in a stadium and When creating a new Stadium, the constructor above will fill a 27x35 two-dimensional array of Seat objects, where each Seat has a number, row and section.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Write down the xml file with markup tags

Write down the XML file with markup tags and some sample data to represent list of invoices. Write the XML tags for two invoices in list.

  Write program which translates letter grade into grade

Write a C++ program which translates the letter grade into a number grade. Letter grades are A B C D F, possibly followed by + or -. Their numeric values are 4, 3, 2, 1, and 0.

  Write down program to arbitarily choose numbers

Write down a program to arbitarily select the numbers of 3 finalist to recieve a prize. Ensure not to choose same number twice. For instance picking finalist 3, 15, 29 woul valid but picking 3,3,31 would be invalid.

  Write application to create-print random phone number

Write the application which creates and prints random phone number of form xxx-xxx-xxxx. Include dashes in the output. Do not let first three digits to contain 8 or 9.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd