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 / moorthy

here a and b are local variable in function swap() where a
and b are swapped inside swap().so that swaping does not
affect variable in main().

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is c called c?

956


What are the types of bitwise operator?

1048


Is a house a shell structure?

1108


What is data types?

1019


Do pointers take up memory?

1079


ATM machine and railway reservation class/object diagram

5191


Explain the properties of union. What is the size of a union variable

1129


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

1078


How can a number be converted to a string?

1240


Explain what are compound statements?

993


Can we initialize extern variable in c?

1075


Can we access the array using a pointer in c language?

994


Which type of language is c?

1020


What is putchar() function?

1077


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1897