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

Answer Posted / george washington

Suppose:
x=1
y=3

Redefine:
x=x+y; //Or, x=1+3=4 and
y=x-y; // y=4-3=1 and
x=x-y; // x=4-1=3

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is conio h in c?

637


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

775


Why c is called object oriented language?

596


How many bytes are occupied by near, far and huge pointers (dos)?

684


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

1676






Why we use stdio h in c?

600


How are strings stored in c?

602


define string ?

681


What is quick sort in c?

590


regarding pointers concept

1585


What is the use of #include in c?

589


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.

613


Explain what are binary trees?

618


What are the types of assignment statements?

638


How do you define a string?

669