wat are the two methods for swapping two numbers without
using temp variable??

Answer Posted / shrikantauti

i dont know the methods but can give the code to swap values without temporary variable.
a b
a=a+b
b=a-b
a=a-b

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c programing language?

608


What is meant by 'bit masking'?

878


how do you programme Carrier Sense Multiple Access

1510


What is structure in c explain with example?

628


What are volatile variables in c?

513






Write a code to remove duplicates in a string.

623


Can you mix old-style and new-style function syntax?

656


What is an lvalue in c?

689


Explain what is operator promotion?

626


I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

555


Where register variables are stored in c?

538


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

660


Write a function that will take in a phone number and output all possible alphabetical combinations

592


What is meant by inheritance?

622


What are multidimensional arrays?

652