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 / tom macdonald

#include<stdio.h>
void main()
{
int x,y;
printf("enter x and y: ");
scanf("%d%d",&x,&y);
x^=y;
y^=x;
x^=y;
printf("elements after swapping: %d,%d\n",x,y);
}

Is This Answer Correct ?    29 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Not all reserved words are written in lowercase. TRUE or FALSE?

1228


What language is c written?

1041


How can you draw circles in C?

1156


What is the use of #define preprocessor in c?

1068


what are the different storage classes in c?

1177


Difference between constant pointer and pointer to a constant.

1131


What are pointers really good for, anyway?

1059


Explain what happens if you free a pointer twice?

1074


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4679


What is the use of void pointer and null pointer in c language?

1116


What are derived data types in c?

1079


I need a sort of an approximate strcmp routine?

1024


What are the characteristics of arrays in c?

1049


Can static variables be declared in a header file?

1058


Explain how do you use a pointer to a function?

1103