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 integers 1 and 32767 without using third
variable

Answers were Sorted based on User's Feedback



how to swap two integers 1 and 32767 without using third variable..

Answer / susmita dutta chowdhury

b=(a+b)-(a=b);
printf("%d %d ",a,b);
explanation:-
b=(1+32767)-(a=32767)
b=32768-32767
b=1
a=32767

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Write an algorithm for a program that receives an integer as input and outputs the product of of its digits. E.g. 1234 = 24, 705 = 0

4 Answers  


which one is not preprocessor directive a)#if b)#elif c)#undef d)#pragma

16 Answers   Accenture, Infosys, TCS, Wipro,


what is the associativity of bitwise OR operator?

1 Answers  


Is malloc memset faster than calloc?

0 Answers  


When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?

0 Answers   TISL,


the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

0 Answers  


what is difference between procedural language and functional language ?

4 Answers   Wipro,


Explain what are run-time errors?

0 Answers  


What is the total generic pointer type?

0 Answers  


write a programming in c language, 1 3 5 7 9 11

2 Answers   NIIT,


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

0 Answers  


say the following declaration is correct nr not. int b=a,n=0;

4 Answers   Wipro,


Categories