Computer Science, asked by 4427, 10 months ago

Write a program to input any two integer numbers and interchange the values using a third variable.​

Answers

Answered by Vyomsingh
10

Answer:

class swap

{

void main(int a,int b)

{

int k=a;

a=b;

b=k;

System.out.println("a:"+a);

System.ouy.println("b:"+b);

}

}

Answered by anindyaadhikari13
65

Here is your answer.

class Program

{

static void main(int a, int b)

{

System.out.println("Before Swapping. ");

System.out.println(" a: " + a);

System.out.println(" b: "+ b);

int temp=a;

a=b;

b=temp;

System.out.println(" After Swapping. ");

System.out.println(" a: "+a);

System.out.println(" b: "+b);

}

}

Similar questions