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...

How to swap values between two variables without using a
third variable?

Answer Posted / vinodkumar

main()
{
int a=10,b=8;
void swap(a,b)
/*it does not return any value because return statement can
return only one value at a time*/
{
a=a+b;/*a=10+8,a=18*/
b=a-b;/*b=18-8,b=10*/
a=a-b;/*a=18-10,a=8*/
printf("after swaping a= %dand b=%d",&a,&b);
}
getch()
}

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we write a method in JSP.If so how?

2032


when will triggars the at new event in abap and web dybn pro?

1974


could u please also write an example of a code that involves instances from an abstract class just as u did for interfaces because u said it could also work which i really doubt. thanks

2138


what is an INI file?

2119


What is the difference between DECISION COVERAGE(DC) and MODIFIED CONDITION/DECISION COVERAGE(MCDC)?

2281


i am exeprienced person what is selection process

1643


define profiler???

2058


What is the use of sas software? Is sas and sap are different?

1529


Can any one give an example (Source Code) on virtual function implemetation in Java?

2027


Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can?t pass the value k to any function also.

973


how do find the user exit for selected feild whatis the process and can u plz explain it

2147


Where do we need Operator overloading?

1127


is it possible to desable particular parameter of the normal orcle report based on some condition ?????? if yes,wht is the function for desabling a parameter...

2068


What is diffrent between Method and and function in c#

2019


Tips for blog integration by www.esteemwebsolutions.com. Can Any body suggest me to how to make wonderful questions on web integration..

2247