import java.util.Scanner; public class GCDProgram2 { public static void main(String[] args) { int length, width; System.out.print("Enter the floor length (cm): "); length = new Scanner(System.in).nextInt(); System.out.print("Enter the floor width (cm): "); width = new Scanner(System.in).nextInt(); while (length != width) { if (length > width) length = length - width; else width = width - length; } System.out.println("You need (" +length+ "cm x " +length+ "cm) tiles."); } }