Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / swechha

a=a-b
b=a+b
a=b-a

if a=5 and b=10 then
a=5-10=(-5)
b=(-5)+10=5
a=5-(-5)=5+5=10

now a=10 & b=5

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are pointers? What are different types of pointers?

1130


What is use of integral promotions in c?

1143


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

1834


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

1094


Explain how can I convert a string to a number?

1090


What is the return type of sizeof?

1061


Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.

5338


Explain two-dimensional array.

1057


Write a code to generate divisors of an integer?

1061


what are non standard function in c

1905


Write a simple code fragment that will check if a number is positive or negative.

1145


How many parameters should a function have?

1181


When was c language developed?

1194


What is the difference between the = symbol and == symbol?

1107


What is the use of function in c?

1186