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...

Write a program to interchange two variables without using
the third variable?

Answer Posted / vijay r15

using many ways we can
perform
#include<stdio.H>
void main()
{
int a=10,b=20;
b=a+b-(a=b);
//or use a^=b^=a^=b;
//or use a=a+b;b=a-
b;a=a-b;
//or use a^=b; b^=a;
a^=b;
printf("%d%d",a,b);
}

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is stack in c?

1121


Lists the benefits of c programming language?

1202


pierrot's divisor program using c or c++ code

2284


Tell us something about keyword 'auto'.

1109


What are logical errors and how does it differ from syntax errors?

1348


What are the different file extensions involved when programming in C?

1340


Give me the code of in-order recursive and non-recursive.

1421


What are the types of macro formats?

1163


How is a null pointer different from a dangling pointer?

1084


Do you know the difference between malloc() and calloc() function?

1110


Explain a file operation in C with an example.

1173


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1538


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

1070


What are the loops in c?

1049


What is the auto keyword good for?

1229