Write a macro for swapping integers

Answer Posted / balaji ramdoss

#define SWAP(a,b) b=a+b-(a=b)

Is This Answer Correct ?    19 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

#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


What is byval and byref? What are differences between them?

1687


What is polymorphism in oop example?

513


What is the renewal class?

2161


What does sksksk mean in text slang?

1532






What do you mean by abstraction?

609


write a program that takes input in digits and display the result in words from 1 to 1000

1985


What is oops with example?

562


What are the benefits of polymorphism?

619


Why do pointers exist?

656


What is oops and why we use oops?

569


write a programe to calculate the simple intrest and compund intrest using by function overlading

1666


What are the 5 oop principles?

598


Why is polymorphism used?

582


What is stream in oop?

837