public class NWDCalculator { public static int findNWD(int a, int b) { if (b == 0) return a; else { return findNWD(b, a % b); } } }