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

Answer Posted / riya ganguly

int a=1,b=32767;
a=a+b;
b=a-b;
a=a-b;
printf("a=%d,b=%d",a,b);

Is This Answer Correct ?    17 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

594


How would you rename a function in C?

612


Define C in your own Language.

633


How do you use a pointer to a function?

625


What are the application of void data type in c?

687






What is a structural principle?

634


How many keywords are there in c?

586


I heard that you have to include stdio.h before calling printf. Why?

582


Explain how to reverse singly link list.

601


What is pragma in c?

623


Array is an lvalue or not?

631


What is the purpose of scanf() and printf() functions?

711


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2181


What is scope rule in c?

600


What are near, far and huge pointers?

640