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

Can the “if” function be used in comparing strings?

1107


Explain the difference between ++u and u++?

1187


Can a pointer be null?

1079


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

2183


Explain what is #line used for?

1122


while initialization of array why we use a[][2] why not a[2][]...?

2401


What is sizeof c?

1120


What is local and global variable in c?

1251


Can you return null in c?

1229


What is #include stdio h?

1178


What is a shell structure examples?

1148


What is volatile keyword in c?

1086


List the difference between a "copy constructor" and a "assignment operator"?

1067


What are the 5 data types?

1211


What is a pragma?

1178