Anonymous

Java Program To Input Two Numbers From Command Line And Swap The Numbers Without Using Third Variable?

3

3 Answers

Alongbar Daimary Profile
LEt me install Java at my PC!!!
Anonymous Profile
Anonymous answered
Create a program that would ask the user to input two numbers and will add and subtract , multiply and divide the two numbers... What would be the possible program????
Anonymous Profile
Anonymous answered
Class swap
{
public void add(ref int a,ref int b)
{
int z;
z=a;
a=b;
b=z;
}
}
class swapdemo
{
static void main()
{
int x=10,y=5;
ankush obj=new ankush();
Console.writeline{"befor value's"+a+","+b};
obj.swap(ref x, ref y);
Console.writeline("after values"+a+","+b);
}
}

Answer Question

Anonymous