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 temporary
variable?

Answer Posted / it diploma student

let a and b be the variables

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

if we take a=5 and b = 7 then

a = 5+7 = 12
b = 12-7 = 5
a = 12-5 = 7

hence swaped...

Is This Answer Correct ?    26 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can insert comments in a c program?

1137


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

1268


What is union and structure in c?

1243


What is void c?

1111


What are the parts of c program?

1109


Why we use int main and void main?

1094


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1070


How can you pass an array to a function by value?

1138


What is the difference between malloc() and calloc() function in c language?

1093


Are negative numbers true in c?

1075


How can you convert integers to binary or hexadecimal?

1045


What is c definition?

1287


Why is c not oop?

985


What is new line escape sequence?

1362


What are 3 types of structures?

1080