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 NOS IN ONE STEP?

Answer Posted / amaresh chandra das

amaresh@Hare-Krishna:~$ cat swp.c
#include<stdio.h>
int
main(){
int a=5,b=6; // Compile using gcc -Wall
#ifdef DEBUG // to avoid compiler warnings
a ^=b^=a^=b;
#endif
printf("value of a is %d and b is %d\n",a,b);
return 0;
}

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the file stdio.h contain?

998


What is a double c?

941


What is the best way of making my program efficient?

961


Where define directive used?

1031


Can the curly brackets { } be used to enclose a single line of code?

1119


What is new line escape sequence?

1264


What is calloc()?

1025


When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1933


Explain why C language is procedural?

1164


what is the basis for selection of arrays or pointers as data structure in a program

4249


What are dangling pointers in c?

1119


What is the most efficient way to count the number of bits which are set in an integer?

1000


What does the function toupper() do?

1064


What should malloc(0) do?

1057


How can I write a function analogous to scanf?

1098