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

Explain what are the different data types in c?

1202


What do mean by network ?

1146


What is string length in c?

1062


What is volatile c?

998


given post order,in order construct the corresponding binary tree

2763


What is a stream?

1120


What are the 5 elements of structure?

1070


What is an expression?

1035


Why c language?

1037


What is abstract data structure in c?

1020


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

1074


What are dangling pointers in c?

1196


What should malloc(0) do?

1103


Can 'this' pointer by used in the constructor?

1079


What is declaration and definition in c?

1077