Write a function that interchange and prints the value of two integers A and B without using
any extra variable in php.
Answers
Answered by
1
Answer:
Program to swap two integers A and B without using any third variable.
public class Class
{
static void interchange()
{
int A , B;
A = A + B ;
B = A - B ;
A = A - B ;
System.out.println( " After interchanging :
" + " A = " + A + " , B = " + B ) ;
}
public static void main(String[] args)
{
interchange();
}
}
Answered by
3
Answer:
I hope it will help you!!
Attachments:
Similar questions