Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What do mean by network ?

1155


how do you programme Carrier Sense Multiple Access

1965


What is a good way to implement complex numbers in c?

1044


Is array name a pointer?

1025


What is the size of structure in c?

1147


What is wrong with this initialization?

1004


Explain what are multibyte characters?

1179


write a program to concatenation the string using switch case?

2089


What is the correct declaration of main?

1206


What are linker error?

1086


What is wrong with this declaration?

1105


What are types of functions?

1031


In a byte, what is the maximum decimal number that you can accommodate?

1132


What is the right type to use for boolean values in c? Is there a standard type?

1005


Why void main is used in c?

1044