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 / jyotsna

let take a single variable 'x'
a=3
b=2
hence
x=a;
a=b;
b=x;
swapping is occured now a=2 and b=3

Is This Answer Correct ?    10 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain setjmp()?

1079


How #define works?

1115


How can I swap two values without using a temporary?

1114


What are the parts of c program?

1104


What does static variable mean in c?

1115


Sir i need notes for structure,functions,pointers in c language can you help me please

2425


How macro execution is faster than function ?

1204


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3945


How do I read the arrow keys? What about function keys?

1090


Explain how can I convert a number to a string?

1154


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

1215


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

2383


Explain what is the purpose of "extern" keyword in a function declaration?

1076


What are the __date__ and __time__ preprocessor commands?

1122


Why c is called a middle level language?

1117