Friday, 17 July 2015

Write a Java Program to Swaping of Two Numbers, Interchange Two Numbers Java Program Material of MCA

Write a Java Program to Swaping of Two Numbers, Interchange Two Numbers

class prog6
{   
    public static void main(String args[])
    {   
        int a=10,b=20;
       
        a=a+b;
        b=a-b;
        a=a-b;
       
        System.out.println("\n A:"+a);
        System.out.println("\n B:"+b);
       
       
    }
}

No comments:

Post a Comment