ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C++  >>  OOPS
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
Write a macro for swapping integers
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Write a macro for swapping integers
Answer
# 1
#define SWAP(a,b) b=a+b-(a=b)
 
Is This Answer Correct ?    1 Yes 0 No
Balaji Ramdoss
 
  Re: Write a macro for swapping integers
Answer
# 2
# define swap(a,b) a = a + b; b = a - b; a = a - b;
 
Is This Answer Correct ?    1 Yes 0 No
Deepak
 
 
 
  Re: Write a macro for swapping integers
Answer
# 3
swap(a,b) a^=b^=a^=b;
 
Is This Answer Correct ?    1 Yes 0 No
Suresh
 

 
 
 
Other OOPS Interview Questions
 
  Question Asked @ Answers
 
What is polymorphism? Explain with an example.  7
WHAT IS THE DIFFERENCE BETWEEN ABSTRUCTION AND ENCAPSULATION? PLEASE EXPLAIN IT.  3
swapping program does not use third variable  4
How is data security provided in Object Oriented languages? ?  3
Why a "operator=(...)" when there is a copy ctor?  2
What is Object and Class? What are the differences between them?  3
What do you mean by public, private, protected and friendly?  1
What is an orthogonal base class?  1
What is namespace?  6
What is encapsulation? TCS8
What is a class? TCS17
what is new modifier in C# HCL6
What is virtual class and friend class? Intel2
tell about copy constructor Siemens1
You have one base class virtual function how will call that function from derived class?  4
What do you mean by pure virtual functions?  4
Why u change company? BOB-Technologies3
How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization? IntraLogic1
What is a mixin class?  3
different types of castings Siemens3
 
For more OOPS Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com