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...

void swap(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
}

in this code always gives the same result for all case

Answer Posted / shouvik mitra

This code gives the interchange values of the two variables.But this code can also give the same result for the two variables when same numbers are inputted in both the variables, i.e. say a=5,b=5.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variables in c?

1054


What does == mean in texting?

1308


Explain the ternary tree?

1026


Why clrscr is used in c?

1017


Why is c called a mid-level programming language?

1208


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

1035


explain what is an endless loop?

1094


Explain goto?

1158


What is n in c?

1056


What are the types of i/o functions?

1347


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

1245


What is function what are the types of function?

1000


What are register variables? What are the advantage of using register variables?

1191


Explain main function in c?

1083


Can a variable be both static and volatile in c?

1044