How to swap two variables, without using third variable ?

Answer Posted / poojamnagal

Num1 = 5
Num2 = 7

Num1 = 5+7 = 12
Num2 = 12- 7 = 5
Num1 = 12-5 = 7

So, Now Num1 = 7
Num2 = 5

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2627


Develop a routine to reflect an object about an arbitrarily selected plane

3274


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

4047


why nlogn is the lower limit of any sort algorithm?

2541


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2497






how to test pierrot divisor

2457


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

6577


How to palindrom string in c language?

9779


Cluster head selection in Wireless Sensor Network using C programming language.

3375


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

2886


How can you relate the function with the structure? Explain with an appropriate example.

3126


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2253


write a simple calculator c program to perform addition, subtraction, mul and div.

3384


What is full form of PEPSI

2116


write a program for area of circumference of shapes

2225