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 to swap two values using a single variable ?

condition: Not to use Array and Pointer ?

Answer Posted / aditya

main(){
int a=10,b=20;
printf("%d%d",a,b);
a^=b,b^=a,a^=b;
printf("%d%d",a,b);

}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the Advantages of using macro

1154


Explain what are bus errors, memory faults, and core dumps?

1262


What does stand for?

1069


Can we compile a program without main() function?

1106


What does calloc stand for?

1145


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1704


What is the purpose of main( ) in c language?

1125


Which node is more powerful and can handle local information processing or graphics processing?

1300


What is string constants?

1135


simple program of graphics and their output display

1977


What is spaghetti programming?

1108


What does the format %10.2 mean when included in a printf statement?

1636


What is main return c?

980


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1054


How the c program is executed?

1139