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 / k.kavitha

NO,if the values of a&b are 10,20 respectively., Then
a=a+b becomes "a=30"
b=a-b becomes b=30-20 i.e., "b=10"
a=a-b gives a=30-10 i.e., "a=20"

Is This Answer Correct ?    20 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define and explain about ! Operator?

952


In C programming, how do you insert quote characters (‘ and “) into the output screen?

1476


Explain how do you convert strings to numbers in c?

1021


Hai what is the different types of versions and their differences

1896


What do you mean by recursion in c?

1055


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

981


Is sizeof a keyword in c?

917


What is the size of enum in c?

1058


Dont ansi function prototypes render lint obsolete?

1061


What is graph in c?

1007


What happens if a header file is included twice?

984


What is an auto variable in c?

1167


What is pointer to pointer in c with example?

981


How can I remove the trailing spaces from a string?

1024


What header files do I need in order to define the standard library functions I use?

997