Anonymous

How To Make A Program To Calculate Sum Of Two Numbers?

2

2 Answers

Anonymous Profile
Anonymous answered
Public class AddNumbers {
     
      public static void main(String[] args) {
      System.out.println("Adding two number");
      System.out.println("   ");
     
     
      int a = 5;
      int b = 5;
      int sum = a + b;
      System.out.println("Sum: " + sum);
     
     
      }
}
Anonymous Profile
Anonymous answered
Here's a sample class that should help explain the logic your looking for.

Visit www.TechWaterCooler.com

public class AddNumbers{

  public static void main(String[] args) {

    System.out.printl of two numbers!");

    int a = Integer.parseInt(args[0]);

    int b = Integer.parseInt(args[1]);

    int sum = a + b;

    System.out.printl " + sum);

  }

}

Answer Question

Anonymous