Write a macro for swapping integers

Answer Posted / suresh

swap(a,b) a^=b^=a^=b;

Is This Answer Correct ?    12 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is property in oops?

565


What is the difference between static polymorphism and dynamic polymorphism?

579


Are polymorphisms mutations?

696


Why do we use oop?

603


What does and I oop and sksksk mean?

650






What is the diamond problem in inheritance?

577


what type of questions

1697


What is the real time example of encapsulation?

594


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

1577


What is polymorphism explain?

685


Why oops is important?

605


How to use CMutex, CSemaphore in VC++ MFC

4327


#include #include #include #include void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

2064


write string class as your own class in java without using any built-in function

1976


Which is better struts or spring?

616