Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Sum of two numbers without using third variable in Java

  1. //Sum of two numbers without using third variable
  2. import java.io.*;
  3. class Addition3
  4. {
  5. public static void main(String args[])throws Exception
  6. {
  7. int a = 5 , b = 6;
  8. a= a+b;
  9. System.out.println("\nSum of two numbers:"+ a);
  10. }
  11. }
  12.  


Output:
Sum of two numbers:11