Answers for "how to do multiplication in java"

1

how does multiplication works in Java

Java provides several arithmetic operations that you can use in your programs. 
 In order to multiply numbers in Java, we will use the asterisk (*) between each number or variable
Posted by: Guest on August-11-2021
0

multiplication without using multiplication in java

public class SumOfElements {
  
  public static void main(String[] args){
    
    int[] a = {1,2,3,4,5};
    
    
    int sum = sumArray(a);
    
   int result = multiply(5,10);
  }
  
  private static int multiply(int i , int j) {
    
    int k = 1;
    int sum = 0;
    
    while(k <= j)
    {
      sum = sum + i;
      k++;
    }
Posted by: Guest on January-22-2021

Code answers related to "how to do multiplication in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language