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

.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

1304


What is wrong with this initialization?

1009


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1088


How to explain the final year project as a fresher please answer with sample project

977


What is static memory allocation?

1183


Here is a good puzzle: how do you write a program which produces its own source code as output?

1106


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16791


What is the symbol indicated the c-preprocessor?

1254


Can we change the value of static variable in c?

1035


Explain what are reserved words?

1107


How many header files are in c?

1040


What is the difference between struct and union in C?

1318


Why #include is used in c language?

1054


What is the explanation for cyclic nature of data types in c?

1221


What is sizeof array?

1061