Product of a and b simple java programming code

Product of a and b 

public class FindProductAB {
    public static int multiply(int a, int b) {
        int product = a * b;
        return product;
    }

    public static void main(String[] args) {
        int Nov = 25;
        int Dec = 4;
        // int prod = multiply(3, 5);
        int prod = multiply(Nov, Dec);
        System.out.println(Nov + " * " + Dec + " = " + prod);
        prod = multiply(3, 5);
        System.out.println(prod);
    }
}


No comments:

Post a Comment

Max Sub Array Sum: Kadane's Algorithm

Code of: Max Sub Array Sum: Kadane's Algorithm. public class MaxSubArraySumKadanesALgorithm {     public static void Kadane ( int ...