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

what is the basis for selection of arrays or pointers as data structure in a program

4309


What is 1f in c?

2658


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2696


What is the difference between memcpy and memmove?

1019


Can we declare a function inside a function in c?

1040


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15807


Why should I use standard library functions instead of writing my own?

1269


Can you please explain the difference between strcpy() and memcpy() function?

1071


What does %c mean in c?

1093


What is c definition?

1276


What is an array? What the different types of arrays in c?

1187


What are the parts of c program?

1101


What type of function is main ()?

1042


What is optimization in c?

1004


What are pointers in C? Give an example where to illustrate their significance.

1227