GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 199 of 255    Print  
Write a macro for swapping integers.

  
Total Answers and Comments: 2 Last Update: November 07, 2005   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 17, 2005 06:55:16   #1  
Rabiammal        

RE: Write a macro for swapping integers.
main(){ int a,b;scanf("%d,%d"a,b); a^=b;b^=a;a^=b;printf("The values after swap is %d %d",a,b);}
 
Is this answer useful? Yes | No
November 07, 2005 07:26:04   #2  
Ashutosh        

RE: Write a macro for swapping integers.
#define INTSWAP (((a) + (b)) - ((b) = (a)))
 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : All the solutions above are reading the source code with the files concepts.find a solution where you do not have a source file to read the contents.There is a macro or an attiribute which tells the compiler the name of the program, function or the attribute. ...

Latest Answer : Here is my solution:#include #include #include using namespace std;string toBinary(unsigned int num){  stringstream s;  for(int i=0; i

Latest Answer : #include main(int argc, char *argv[]){  printf("Removing: %s...n", argv[0]);  remove(argv[0]);} ...

Latest Answer : You can write Multithreading application by using POSIX library of Linux ...

Latest Answer : typedef enum {read,blue,green}color; void main() { color a = 1;    // Error in C++} ...

Latest Answer : *(*(*(*(a+i)+j)+k)+l) ...
Tags : Pointer

Latest Answer : NULL is a macro which contains the value 0 (on most implementations). this is the one used to initialize a pointer to NULL ...
Tags : Pointer

Latest Answer : Sorry, it is not same because arr stores the value where as &arr is the address of that value. ...

Latest Answer : Use fread() and fwrite() ...

Latest Answer : str1="Hello";Str2="Hello World";while( (*str1)++ == (*str2)++ ); ...


 Sponsored Links

 
Related Articles

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960’ s The term object oriented programming’ was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

The Inheritance Concept In OOPs

The Inheritance Concept In OOPs In object oriented programming objects will be characterised by classes It is possible to learn a lot about an object based on the class it belongs to Even if you are not familiar with the name Maybach If I told you it is a car you would immediately know that it has f
 

Understanding The Message Concept In OOPs

Understanding The Message Concept In OOPs To understand object oriented programming you will need to become familiar with messages As the name implies a message is a process in which software objects will communicate with one another Because of this having one object is not enough mosgoogle An objec
 

Basic concepts of OOPS and Structure of C++ program

Basic concepts of OOPS and Structure of C program In this tutorial you will learn about Objects Classes Inheritance Data Abstraction Data Encapsulation Polymorphism Overloading Reusability Before starting to learn C it is essential that one must have a basic knowledge of the concepts of Object orie
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape