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

Answers were Sorted based on User's Feedback



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

Answer / susmita dutta chowdhury

b=(a+b)-(a=b);
printf("%d %d ",a,b);
explanation:-
b=(1+32767)-(a=32767)
b=32768-32767
b=1
a=32767

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What are the different types of constants?

0 Answers  


Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use an external variable to store the count. Second, use a local variable. Which is more appropriate?

2 Answers  


WAP to find that given no is small or capital

3 Answers  


Write the program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.

3 Answers   Google,


Are local variables initialized to zero by default in c?

0 Answers  






do you think its fraud or original company?

0 Answers  


What is the difference b/w Structure & Array?

6 Answers  


How can you find the day of the week given the date?

0 Answers  


what is dangling pointer?

1 Answers   LG Soft,


What are the types of type specifiers?

0 Answers  


What is the use of typedef in structure in c?

0 Answers  


What is #line?

0 Answers  


Categories