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 is difference between array and structure in c?

1175


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

2091


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

4301


Why c is called top down?

1150


How can I read data from data files with particular formats?

1042


How does pointer work in c?

1118


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1876


What is the size of enum in c?

1108


What is getch () for?

1221


Why header files are used?

1118


What the different types of arrays in c?

1057


What are the advantage of c language?

1048


what is use of malloc and calloc?

1895


Describe the modifier in c?

1097


Where are local variables stored in c?

1035