title: Arithmetic that takes three command-line arguments and output required as java Arithmetic: 3 + 2 = 5
body: <pre><code>class CommandLineArgs {
    public static void main(String args[]) {
      int l = args.length;
      int sum = 0;
  
      for (int j = 0; j &lt; l; j++) {
        sum = Integer.parseInt(args[j]) + sum;
      }
      System.out.println("The Sum of All Elements entered at command line is : " + sum);
    }
  }
  </code></pre>
  
  <p>I tried using arguments but not able to do in using function as my required output is a=number1 and b=number2 and c=operator (+,-,/,*). Please help me in writing the program.</p>