void swap(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
}

in this code always gives the same result for all case

Answer Posted / prateek

Actually this code is for interchanging values of two
variables without using third variable

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by c?

590


What is typedef?

680


What is size of union in c?

582


Why does not c have an exponentiation operator?

630


What are the advantages of c preprocessor?

714






What does stand for?

599


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

759


What is I ++ in c programming?

629


What is a void pointer in c?

609


What is the use of bitwise operator?

693


What are the header files used in c language?

590


How can I trap or ignore keyboard interrupts like control-c?

620


define string ?

670


What is a constant?

636


What is c variable?

555