How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance

Answer Posted / raghuram.a

int x,y;

x =x-y;
y =y+x;
x =y-x;

or

int x,y;

x=x^y;
y=x^y;
x=x^y;

Is This Answer Correct ?    11 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

663


Why is c so popular?

656


‎How to define structures? · ‎

639


What are the main characteristics of c language describe the structure of ac program?

616


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

1895






Does c have class?

619


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

611


Why we write conio h in c?

573


What is difference between main and void main?

637


Why is void main used?

625


Why do we use c for the speed of light?

610


can we change the default calling convention in c if yes than how.........?

2037


Explain what is the difference between null and nul?

665


What is the use of typedef in structure in c?

551


find out largest elemant of diagonalmatrix

1653