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 many ways are there to swap two numbers without using
temporary variable? Give the each logic.

Answer Posted / kishan gowda

One more method its bit complicated from the people from
the non electronics background......
void main()
{
pf(" a and b ");
sf("%d %d", &a, &b);
a= a^b;
b= b^a;
a= a^b;
pf("Swapped no's are a=%d and b=%d" ,a ,b);
}

Is This Answer Correct ?    24 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you know about the use of bit field?

1030


What is malloc return c?

1010


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

3131


What is a void pointer in c?

1090


How can I convert a number to a string?

1140


can anyone please tell about the nested interrupts?

2106


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

1241


Why is a semicolon (;) put at the end of every program statement?

1056


What does the file stdio.h contain?

1039


What is %d used for?

1023


What is build process in c?

1130


What are the salient features of c languages?

1084


What are pointers? What are different types of pointers?

1119


Explain what is the difference between functions getch() and getche()?

1037


Is flag a keyword in c?

1142