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

Explain the use of bit fieild.

1142


What is malloc and calloc?

1060


How is pointer initialized in c?

1030


Where local variables are stored in c?

1012


Explain what are the advantages and disadvantages of a heap?

1094


Can you write the algorithm for Queue?

2125


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1868


how do you execute a c program in unix.

1116


What is pragma c?

1126


What is the collection of communication lines and routers called?

1129


Explain what are the different data types in c?

1225


Why use int main instead of void main?

1125


Can we access array using pointer in c language?

1096


Define VARIABLE?

1172


What is getch c?

1301