Find the greatest common divisor between two inputed integer

Assignment Help JAVA Programming
Reference no: EM13940973

I have to write an interactive program that will find the Greatest common divisor between two inputted integers.

Here is what i have so far.

//
//
//
// This Program will find the greatest common divisor between two inputted integers.
//
//

import java.io.*;

public class space11{

static BufferedReader keyboard =
new BufferedReader( new InputStreamReader(System.in));

public static void main(String args[]) throws IOException{

System.out.println();
System.out.println();

int divisor;
int small_number, larger_number;

System.out.println("This Program will fins the GCD between two numbers");
System.out.println();
System.out.print("Please enter the first number here: ");
first_number = Integer.parseInt(keyboard.readLine().trim());
System.out.println();
System.out.print("Please enter the second number here: ");
second_number = Integer.parseInt(keyboard.readLine().trim());
System.out.println();

for ( divisor = 2 ; divisor <= small_number; divisor++);
{

if ( small_number % divisor == 0 && larger_number % divisor ==0)

Reference no: EM13940973

Questions Cloud

Discuss the various logistical issues : Discuss the various logistical issues you would have to consider before commencing the import of products from the two new factories, taking into account the various procedures that need to be considered,
Search for organisations interested in its purchase : M J Morris is a prosperous unquoted company, whose owners are also the directors. The directors have decided to sell their business, and have begun a search for organisations interested in its purchase. They have asked for your assessment of the p..
Provide the journal entry for december : Prepare a bond amortization table assuming straight-line amortization. Provide the journal entry for December 31, 2010.
What is the expected value of earning a college degree : If the lifetime earnings of a high-school graduate average $1,200,000, what is the expected value of earning a college degree?
Find the greatest common divisor between two inputed integer : I have to write an interactive program that will find the Greatest common divisor between two inputted integers.
How much gasoline per year is being converted : How much money can be saved for 15,000 miles of driving per year and how much gasoline per year is being converted if one million people use the E20 fuel?
Preparing a complete statement of cash flows : Preparing a Complete Statement of Cash Flows. The following information is also available for 2008: Plant assets were sold for their book value of $180 during the year. The assets had an original cost of $290
What is a performance management system : 1. What is a performance management system? 2. List 5 of the strategic purposes an organization may have for their performance management system.
Did tyler make the most economical decision : Did Tyler make the most economical decision? What other options should Tyler have explored? In your answer, be sure to state your assumptions and quantify your thinking.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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