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

How does struct work in c?

1040


How will you divide two numbers in a MACRO?

1091


What’s a signal? Explain what do I use signals for?

1072


What are the types of operators in c?

1027


What is enumerated data type in c?

1045


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

971


How do you determine the length of a string value that was stored in a variable?

1097


What is openmp in c?

981


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

2188


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2420


What is s in c?

1012


What is the total generic pointer type?

1123


What is the use of getchar() function?

1091


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

1106


Why c is a mother language?

986