fork download
  1. /* package whatever; // don't place package name! */
  2. import java.io.*;
  3. /* Name of the class has to be "Main" only if the class is public. */
  4. class Ideone
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. System.out.println("The Java Add/Multiply Program.");
  9. int num1 = 25;
  10. int num2 = 25;
  11. int num3 = (num1 + num2);
  12. System.out.println("NUM1 " + num1 + " NUM2 " + num2 + " NUM3 " + num3);
  13. int num4 = 35;
  14. int num5 = 35;
  15. int num6 = (num4 * num5);
  16. System.out.println("NUM4 " + num4 + " NUM5 " + num5 + " NUM6 " + num6);
  17. }
  18. }
Success #stdin #stdout 0.14s 55880KB
stdin
1
2
10
42
11
stdout
The Java Add/Multiply Program.
NUM1 25 NUM2 25 NUM3 50
NUM4 35 NUM5 35 NUM6 1225