| 6 | import java.util.Scanner; |
| 7 | |
| 8 | public class Euclids |
| 9 | { |
| 10 | private Euclids(){} //this class is not for instantiation |
| 11 | |
| 12 | public static int GCD(int a, int b) |
| 13 | { |
| 14 | if(b==0) |
| 15 | return a; |
| 16 | return GCD(b, a%b); |
| 17 | } |
| 18 | |
| 19 | public static void main(String[] args) |
| 20 | { |
| 21 | int a,b; |
| 22 | Scanner scan = new Scanner(System.in); |
| 23 | System.out.print("Enter values for a and b : "); |
| 24 | a = scan.nextInt(); |
| 25 | b = scan.nextInt(); |
| 26 | System.out.println("GCD of " + a + " and " + b + " is " + GCD(a,b)); |
| 27 | scan.close(); |
| 28 | } |
| 29 | } |
nothing calls this directly
no outgoing calls
no test coverage detected