Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

Program of SWAP:-
class Swap2
{
   public static void main(String args[])
   {
       int a=10,b=2,temp;
       System.out.println("value is " + a + "," + b);
       a=a+b;
       b=a-b;
       a=a-b;
       System.out.println("value is " + a + "," + b); 

   }

}


Program of Reverse:-

class Rev
{
  public static void main(String args[])
  {
     int num=89145,num1,num2,num3,num4,num5;
     num1=num%10;  //5
     num=num/10 ;  //1234
     num2=num%10;  //4
     num=num/10;   //123
     num3=num%10;   //3
     num=num/10;   //12
     num4=num%10;  //2
     num5=num/10;  //1
     int res = num1*10000+num2*1000+num3*100+num4*10+num5*1;
     System.out.println(res); 
   

  }

}


Program of Swap:-

class Swap
{
   public static void main(String args[])
   {
       int a=10,b=2,temp;
       System.out.println("value is " + a + "," + b);
       temp=a;
       a=b;
       b=temp;
       System.out.println("value is " + a + "," + b); 

   }

}

Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post