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 / vignesh1988i

as for i know their are two different logics for the
swapping techinque.... swapping is a type of techinque used
for interchanging the two varibles in the operating
memory....
1) using only variables
2) using EX-OR operator '^'
first logic only know.
void main()
{
int a,b;
printf("enter the a&b");
scanf("%d%d",&a,&b);
a+=b;
b=a-b;
a-=b;
printf("a=%d\nb=%d",a,b);
getch();
}

Is This Answer Correct ?    48 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a c token and types of c tokens?

1128


List the difference between a "copy constructor" and a "assignment operator"?

1067


How can I make sure that my program is the only one accessing a file?

1347


What are shell structures used for?

1095


What is the significance of c program algorithms?

1193


What is the main difference between calloc () and malloc ()?

1233


What is anagram in c?

980


What are local static variables?

1207


Can the sizeof operator be used to tell the size of an array passed to a function?

1176


What is static function in c?

1166


What is preprocessor with example?

1116


How can I pad a string to a known length?

1082


Explain main function in c?

1135


Explain a file operation in C with an example.

1173


What does sizeof int return?

1132