PROGRAM TO SWAP TWO NUMBERS – JAVA

//PROGRAM TO SWAP TWO NUMBERS
class Swap
{
public static void main(String a[])
{
int x=11,y=7,z;
System.out.println(“before swaping the numbers are: x:”+x+” y:”+y);
z=x;
x=y;
y=z;
System.out.println(“after swaping the numbers are: x:”+x+” y:”+y);
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *