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 / venkatesh sabinkar

as far i know i know two logics they are
first one
void main()
{
int a,b;
printf("eneter any two values");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("a=%d\nb=%d",a,b);
getch():
}
second one
void main()
{
int a,b;
printf("eneter any two values");
scanf("%d%d",&a,&b);
a=a*b;
b=a/b;
a=a/b;
printf("a=%d\nb=%d",a,b);
getch():
}

Is This Answer Correct ?    24 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

C language questions for civil engineering

1722


What are the ways to a null pointer can use in c programming language?

1137


What are pointers? What are different types of pointers?

1150


Explain what is wrong in this statement?

1126


What is the advantage of c?

1132


Explain how can type-insensitive macros be created?

999


What is data structure in c programming?

1083


What are the different types of constants?

1077


What is c preprocessor mean?

1320


What is the meaning of c in c language?

1175


Find MAXIMUM of three distinct integers using a single C statement

1071


write a program to find the given number is prime or not

4772


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

2415


Can you write the algorithm for Queue?

2125


Explain b+ tree?

1077