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 is use of pointer?

1163


When should the const modifier be used?

1151


what do you mean by enumeration constant?

1060


List the difference between a While & Do While loops?

1147


Why is a semicolon (;) put at the end of every program statement?

1123


Can the sizeof operator be used to tell the size of an array passed to a function?

1173


What are unions in c?

1083


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1145


What are the types of bitwise operator?

1164


What does a pointer variable always consist of?

1155


How is pointer initialized in c?

1088


Why is c called a mid-level programming language?

1241


Tell us two differences between new () and malloc ()?

1272


What does stand for?

1139


What is the general form of function in c?

1068