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 struct node in c?

1125


Why c is procedure oriented?

1123


What is the difference between int main and void main?

1095


Explain how can type-insensitive macros be created?

1043


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

1308


What is the difference between struct and typedef struct in c?

1171


What is c programming structure?

1277


What is the basic structure of c?

1154


How does pointer work in c?

1194


write a program to print data of 5 five students with structures?

2089


Can stdout be forced to print somewhere other than the screen?

1089


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3603


Differentiate between Macro and ordinary definition.

1466


What are the advantages of using new operator as compared to the function malloc ()?

1407


What are enums in c?

1288