write a program to swap Two numbers without using temp variable.

Answer Posted / rohan

four Types with single statements:

1.b=(a+b)-(a=b);

2.a^=b^=a^=b;

3.a=a+b;
b=a-b;
a=a-b;

4.a=a*b;
b=a/b;
a=a/b;


rohanraju143@gmail.com from NIT Waramgal

Is This Answer Correct ?    18 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of macro formats?

596


i want to know the procedure of qualcomm for getting a job through offcampus

1923


Describe the modifier in c?

592


What is signed and unsigned?

629


Write a program to check prime number in c programming?

584






How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

15477


Are pointers integers in c?

600


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

1893


What are qualifiers and modifiers c?

537


What are the keywords in c?

636


What is a pointer in c plus plus?

684


Explain how do you use a pointer to a function?

630


will u please send me the placement papers to my mail???????????????????

1355


Explain what are preprocessor directives?

614


a program that can input number of records and can view it again the record

1474