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

Difference between delegates and Events?

2137


when we use mantis? how learn mantis?

2144


SAS question: I have 50 fils a1,a2,...,a50. the primary key is upc. then if i want to merge all 50 files, the code is as follows, data test; merge a1 ... a50; by upc; run; we know that writing all 50 files name is time consuming, is there any standard format of this code?

1902


iam confused among testing ,.net and java. can anybody help me.

1974


Write a program to reverse a number?

1138


In project we have Documentation phase also,in that what is micro and macro designing?

1823


Busy waiting is a method whereas a taskwaits for a given event by continiously checking for an event to occur. What is the main problem with this approach

1840


how to convert the data from HTML file to SAS dataset?

2698


What for decision coverage and modified condition decision coverage are used? Wat is the difference between them?

2118


Suppose server object is not loaded into the memory, and the client request for it , what will happen?

2629


Write a shell program. Enter number of days from keyboard. Find out the number of years, month and days it contains

2027


You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)

1037


Hi all... I had completed MSC(Computer) and had join the construction company based on sap.they want me to work on abap.but software company is totally different from construction company and they want me 2 grasp it as fast i can.i am finding it difficult.what should i do??????

1811


My Qualification is MCA.My interview is on 5th may.They may ask q as------AS u r MCA...Why u r not tring anywhere else? What can be the ans?

1912


how do u handle table control inbdc explain the process in steps iwant the answer in urgent please forward this even i know how to explain there

2174