About Me

My photo
Raipur, Chhattisgarh, India
Hi , I am Amit Thakur. I have worked as a QA Engineer for two years and as a Java Developer for one year in NIHILENT TECHNOLOGIES PVT. LTD., Pune.Currently I am working as DEAN (Research & Development) in Bhilai Institute of Technology, Raipur.

Monday, July 25, 2011

***Swapping of two numbers***


//Swapping of two numbers
public class Swapping
{
public static void swap(int i,int j)
{
    int temp=i;
    i=j;
    j=temp;
    System.out.println("After swapping i = " + i + " j = " + j);
  }
  
public static void main(String[] args)
{
    int i=1;
    int j=2;
  
  System.out.println("Before swapping i="+i+" j="+j);
    swap(i,j);
  
  }
}


No comments: