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 the difference between new and malloc functions?

1052


Is a house a shell structure?

1108


Why do we use namespace feature?

1009


What is function what are the types of function?

948


What is function prototype?

1057


What is chain pointer in c?

1008


What is getch?

1089


What is the scope of an external variable in c?

982


Why is C language being considered a middle level language?

1043


Why ca not I do something like this?

971


What is wrong in this statement?

1080


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

1167


Can you return null in c?

1094


What is #include conio h?

945


What are the different types of endless loops?

1028