write a program to swap Two numbers without using temp variable.
Answer Posted / ramprasad
class Swap
{
static int iValue,jValue,tot;
public static int swap(int A, int B){
tot = A+B;
iValue = tot-B;
jValue = tot-iValue;
return iValue;
//return jValue;
}
public static void main(String[] args)
{
System.out.println(Swap.swap(5,6));
}
}
| Is This Answer Correct ? | 23 Yes | 8 No |
Post New Answer View All Answers
What do mean by network ?
how do you programme Carrier Sense Multiple Access
What is a good way to implement complex numbers in c?
Is array name a pointer?
What is the size of structure in c?
What is wrong with this initialization?
Explain what are multibyte characters?
write a program to concatenation the string using switch case?
What is the correct declaration of main?
What are linker error?
What is wrong with this declaration?
What are types of functions?
In a byte, what is the maximum decimal number that you can accommodate?
What is the right type to use for boolean values in c? Is there a standard type?
Why void main is used in c?